WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Query Multiple Taxonomies] How to use it in single-(post-type).php

[Plugin: Query Multiple Taxonomies] How to use it in single-(post-type).php

  • AliMH
    Member

    @alimh

    hi,
    i wanna use this plugins as by taxonomy related posts, is there any function that i can call within my single post type file to get taxonomy related posts (base on genres or …) ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author scribu
    Member

    @scribu

    You could do something like this (not tested):

    $current_genre = reset( wp_get_object_terms( $post->ID, 'genre' ) );
    
    $related = new WP_Query( array( 'genre' => $current_genre->slug ) );
    
    while( $related->have_posts ) : $related->the_post();
    // display related post
    endwhile;

    Otherwise, you might be better off with a plugin like YARPP.

    mistercyril
    Member

    @mistercyril

    YARPP doesn’t support custom Post types at the moment… bummer 🙁

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Query Multiple Taxonomies] How to use it in single-(post-type).php’ is closed to new replies.