Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jonathandejong

    (@jonathandejong)

    Hey Byron,

    You can look at the global $wp_query object and fetch the current taxonomy(s) from there ??

    If you also want to make sure it’s only displayed when on a filtered page by BTF you can wrap your code in
    if( is_btf_filtered() ) { //hello }

    Thread Starter Byron Hasegawa

    (@byron222)

    i try but, couldn’t get….

    i filter my post with
    custom post type[office] & 2 custom term
    1. customterm[area]
    2. customterm[service]

    and when i select [area]:B and [service]:A

    i want to display in my sidebar (not in the archive template) the slug name of
    [area]:B and [service]:A...

    but when i try

    global $wp_query;
    var_dump($wp_query);

    i get another taxonomy which is another custom_term
    [city]:A

    what can i do?

    Thread Starter Byron Hasegawa

    (@byron222)

    Please, I need this…

    I look forward to receiving your advice on this issue.

    Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Byron,

    If you are on a filtered results page by BTF there will be taxonomy => term values in $wp_query for the taxonomies you’ve filtered on. If there is not, you have a different issue where you somewhere before/after overwrite the global query. That usually happens if you have a custom loop and don’t reset the post object after wp_reset_postdata(); OR if you (god forbid) are using query_posts to modify the global query.

    If you’re not on a filtered results page then it’s not weird that there is no data for the taxonomies.

    One thing you can test is to use the Filter info widget BTF supplies to see if that picks up the correct values. If not, you definitely have an issue with overwritten objects.

    Thread Starter Byron Hasegawa

    (@byron222)

    Thank you very much!!

    Your are totally right!

    That usually happens if you have a custom loop and don’t reset the post object after wp_reset_postdata(); OR if you (god forbid) are using query_posts to modify the global query.

    this was the problem!

    Thank you always!

    Plugin Author Jonathandejong

    (@jonathandejong)

    Glad to hear it worked itself out ??

    Best of luck in your project.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show my filter in Sidebar’ is closed to new replies.