• Hi guys.
    I created a site and I wanted to use custom taxonomies. I created two taxonomies and I continued to work on the theme. Until…

    I’m at this point when, on the single post page, i have to show some sidebar boxes related to current taxonomy.

    So, basically, right now I’m stuck with finding the current post taxonomies.

    There is nothing related to taxonomy in $wp_query->get_queried_object();

    Do I miss something on Codex?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • scribu

    (@scribu)

    I’m at this point when, on the single post page, i have to show some sidebar boxes related to current taxonomy.

    If you’re on a single post page, I don’t really understand what you mean by “current taxonomy”. A post can have multiple taxonomies.

    Careful not to confuse ‘taxonomy’ (ex: post_tag, category) with ‘term’ (ex: dog, cat, news, etc.).

    $terms = get_the_terms( $post_id, $taxonomy);

    Thread Starter Ionut Staicu

    (@iamntz)

    Careful not to confuse ‘taxonomy’ (ex: post_tag, category) with ‘term’ (ex: dog, cat, news, etc.).

    Yep, the term is what I really want 😀

    $terms = get_the_terms( $post_id, $taxonomy);

    Dude! THANKS! (translation:works like a charm!)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Current post is under what taxonomy?’ is closed to new replies.