Tag Info

Hot answers tagged

2

I would use a custom query like this: $amsterdamstore_args = array( 'post_type' => 'store', // This is your custom post type 'tax_query' => array( array( 'taxonomy' => 'city', // This is your custom taxonomy 'terms' => 'Amsterdam', // The term you search for 'field' => 'name', // Check against the term's ...


2

You didn't need to post all that code to wade through! The problem is here: <?php global $wpdb; function get_tag_data2() { You need to global inside the function - that's the point of global: <?php function get_tag_data2() { global $wpdb; // Original function code }


1

You need a custom query and loop here, at least that's how I do it. $args = array( 'post_type' =>'store', 'taxonomy' => 'city', 'term' => 'your list here' 'posts_per_page' => 5 ); $loop = new WP_Query($args); if($loop->have_posts()): while($loop->have_posts()): do stuff here endwhile; endif; You will probably want to ...


1

That is not how $wpdb->prepare works. You feed prepare a string with sprintf-like placeholders, and the appropriate replacement values. Placeholders The query parameter for prepare accepts sprintf()-like placeholders. The %s (string), %d (integer) and %f (float) formats are supported. (The %s and %d placeholders have been available since the ...



Only top voted, non community-wiki answers of a minimum length are eligible