Site logo

Archived topic

check whether on taxonomy page

6 replies · Started by Marco on January 31, 2019

Viewing posts 1–7 of 7

Hello
what hook do I need to use in order to be able to check whether I'm on a tag archive/taxonomy page - as I understand is_tax() should give me the answer but I don't know where to put it in my custom functions file

Thanks Tom - I basically like to have a function where I can check if I'm currently on a taxonomy archive page - pre-get-post didn't work.

What does the function do if it detects you're on a taxonomy page?

let's say I'm on a page like: http://localhost/cms/wp-vitus/tag/project-mgmt/ - a taxonomy page - in the right sidebar I'd like to show all the other post titles that also have the tag slug "project-mgmt" - kind of a contextual widget that is created/populated dynamically - I don't whether it is even possible to dynamically ad a widget to the right sidebar - however first I need to figure out whether I'm on a taxonomy page or not.

wp_head, pre_get_posts don't seem to work when running is_tax()

I might got a little closer - `is_tag()' seems to do the trick to find out whether I'm on a tag page

This archived topic is closed to new replies.