How do you search for a post by custom taxonomy?

For the record I found an answer to this question in the end – I needed to use a meta query rather than a taxonomy query. The correct code ended up being this: $relatedBlogPostArgs = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, ‘order’ => ‘DESC’, ‘orderby’ => ‘date’, ‘meta_query’ => array( array( … Read more

Passing a variable to register_taxonomy()

It turns out the issue here is the foreach statement. I changed the loop from foreach ($taxonomies as $taxonomy) { to for ($counter=0; $counter < sizeof($taxonomy); $counter++) { as well as all relivant itirators so…. register_taxonomy( $taxonomy->singular_name, ‘book’, $tagArgs ); became register_taxonomy( $taxonomy[$counter]->name, $book, $args ); and all went well. I suspect this is a … Read more