CPT archive page – show one post from each taxonomy term

So I went ahead and did the multiple loop thing, as I had done before. I’m always interested in seemingly cleaner/simpler solutions, but sometimes you just have to keep moving. This is the code I’m using: <?php $args = array( ‘post_type’ => ‘projects’, ‘project_category’ => ‘websites’, ‘orderby’ => ‘menu_order’, ‘showposts’ => 1 ); $posts = … Read more

How to display posttypes and taxonomy in standard posts, not in a separate label?

when you register a taxonomy, the second argument is the post type it is available for: register_taxonomy( $taxonomy, $object_type, $args ); if you want the taxonomy to work for a custom type as well as standard posts, you can pass an array of types: $object_type = array( ‘your_custom_type’, ‘post’ ); alternately, you can use register_taxonomy_for_object_type: … Read more

Tax_Query using WP_Query not working

You aren’t looping through the results. Here is your code: $m = new WP_Query( $myquery ); if ( $m->have_posts() ) : $m->the_post();?> <ul><li <?php post_class();?>><a href=”https://wordpress.stackexchange.com/questions/83409/<?php the_permalink(); ?>”><?php the_title(); ?></a></li></ul> <?php endif; wp_reset_postdata(); ?> There is no Loop. You just check for the existence of posts, echo some information about the first one and quit. … Read more

Variable Not Working Inside is_author() Array

You’ve converted $taxonomy_id_list to a comma separated string then shoved that string into an array. Your array now looks like array( “1,2,3,4” ); That is not going to match any author ID. You are misunderstanding what implode does. This–1,2,3,4,5,6,7— is a set of integers. If place in the array like this– array(1,2,3,4,5,6,7)— you get an … Read more