one get_posts to return a number of custom posts for each meta value

Short answer: no. But if you want to use one loop for all your needed posts, you can do something like this: $args = array( ‘post_type’ => ‘product’, ‘meta_query’ => array( array( ‘key’ => ‘cf_type’, ‘value’ => ‘fog’, // need to have 10 with value ‘fog’ and 10 with value ‘gof’ ) ), ‘numberposts’ => … Read more

Taxonomy Grid Archive Help?

To retrieve all the terms in a taxonomy, you can make use of get_terms Here is an example from that page to retrieve the term names of a custom taxonomy $terms = get_terms(‘my_taxonomy’, ‘hide_empty=0’); if ( !empty( $terms ) && !is_wp_error( $terms ) ){ echo “<ul>”; foreach ( $terms as $term ) { echo “<li>” … Read more

Can you get the themes options page to turn on/off which custom post types are registered?

If you can get a dynamic variable value of the brand, then you can load wanted CPT. Inside function.php Create a link to your new function “remove_cpt_multisite”. Ex: // Remove menu items for users include (TEMPLATEPATH . ‘/assets/functions/remove_cpt_multisite.php’); The template itself (remove_cpt_multisite.php) : <? add_action( ‘admin_init’, ‘my_remove_menu_pages’ ); function my_remove_menu_pages() { $my_brand_variable = “get your … Read more

Problem to show custom post type in archive page category wise

You need to check the information that their is in action variable. $action = (isset($_REQUEST[‘ac’])) ? $_REQUEST[‘ac’] : ‘none’; var_dump(“action: “+$action); With this line, you will be able to review it’s content and you will see that you don’t get the correct information. I guess that your dev database is out off synch with your … Read more

Best way to structure article and issue relationship for CPT

I think the easiest way would be like this: Custom Taxonomy Issue Custom Post Type Article You can add custom fields to Taxonomies like described here: https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/ This way, you get the relation between articles and issues, you can add information about the issue by the custom taxonomy fields, and you can use the taxonomy … Read more

If taxonomy show class of active

You should go and read Debugging in WordPress, as this problem could be easily solved with debug set to true is_taxonomy() was depreciated in version 3.0 already, and has been replaced with is_tax( $taxonomy, $term ) You’ll just need to specifiy your taxonomy and term in the parameters and you should be good to go

Show all post of a taxonomy with one specific term not working

As written here, you need to use two nested arrays in the tax_query argument. So, with your arguments it should look like this: $args = array ( ‘post_type’ => ‘restaurants’, ‘tax_query’ => array (array( ‘taxonomy’ => ‘location’, ‘field’ => ‘slug’, ‘terms’ => ‘citya’) ), ‘order_by’ => ‘title’, ‘order’ => ‘ASC’ ); If you only need … Read more