I have a page template and at the bottom, I want a loop of posts based on a custom field value - store_name
This is what I have:
<?php global $wp_query; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts(array('posts_per_page' => '10','paged'=>$paged,'category_name'=>'<?php echo get_post_meta($post->ID, 'store_name', true); ?>')); ?>
But of course that doesn't work because I know my syntax is incorrect with the nested php statement, but how do I fix it?