Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have the following code that gets the slug of the taxonomy "author" from a custom post type "books" and gets the post from another custom post type "authors" that has the same slug.

<?php

global $post;
$bookauthor = wp_get_post_terms( $post->ID, 'author' );
$slug = array_shift( $bookauthor );
$custom_query = new WP_Query( array( 'post_type' => 'authors','name' => $slug->slug ) );

if($custom_query->have_posts()) : 
while($custom_query->have_posts()) : 
$custom_query->the_post();

?>

Now I need to get the slug of a child taxonomy of "author" called "new-author" but don't know how to modify the code.

Suggestions welcome!

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.