category__and works, but why?
category__and works, but why?
category__and works, but why?
Looks like all I needed was to include ‘posts_per_page’ => -1 in the $query_args array. Final, working code: <ul class=”tag-list”> <?php $query_args = array( // Easier to call the parent category, “recipe” instead of dealing with all these ids // ‘cat’ => ‘101,94,93,56,72,99,100,63,98,95,96,80,4’, // Calling recipes (4) and ingredients (56) category ids – specific recipe … Read more
If I’m not totally missing some thing this should be achievable with a minor change to your code. You can not use post_class() in your code as it outputs/echos the classes. But there is get_post_class(), which does return the classes, but they are returned as a array. So you need to make a string out … Read more
Grouping parent categories into sections
Your query explicitly excludes the current post with this: ‘post__not_in’ => array($post->ID), remove that and it will return the current post within the results.
wp_list_category only showing to logged in uers
Alright, I solved it: I queried the year and month of the page we’re on with: $year = get_query_var(‘year’); $monthnum = get_query_var(‘monthnum’); And then I added date parameters to each WP_Query: $col1 = new WP_Query( array( ‘year’ => $year, ‘monthnum’ => $monthnum, ‘posts_per_page’ => 1, ‘cat’ => 31 ) ); This allows me to split … Read more
you should try that with a custom Nav Walker. Here is a code example how it should work. I check if the menu item is a category link. If yes, there is another check -> category count.If the category don’t have any posts the link won’t be passed to the html output. class Menu_Category_Count extends … Read more
Backend – Categories and Menus conflicts
You could try $slidercategories_array = array(3,5,6,9,10,11,12,23,24,27); $in = implode( ‘,’, array_map( ‘absint’, $slidercategories_array ) ); global $wpdb; $sql = $wpdb->prepare( ‘SELECT tt.term_id, MAX(p.post_date) AS max_date FROM ‘ . $wpdb->term_taxonomy . ‘ AS tt ‘ . ‘ JOIN ‘ . $wpdb->term_relationships . ‘ AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id’ . ‘ LEFT JOIN ‘ . $wpdb->posts … Read more