I have built a custom multi field search function and I am trying to populate the search results page with the product listing and the "Add To Cart" button.
I have grabbed all items that match the search criteria and am using the following to build a list of items on the serach results page -
if (is_array($searched_posts)){
foreach ($searched_posts as $searched_post) {
$post_id = $searched_post->ID;
echo "<h1 class=\"entry-title\">ID) . "\">" . $searched_post->post_title . "</h1>";
echo get_post_meta($searched_post->ID,'width',true) . "/";
echo get_post_meta($searched_post->ID,'sidewall',true) . "R";
echo get_post_meta($searched_post->ID,'radius',true) . "
";
echo do_shortcode('[add_to_cart id=\"$post_id\"]');
echo "ID) . "\">Read More";
}
}
Unfortunately I can not get the shortcodes to work - any hints?