knowing in which category a user was when he clicked on a post (2 posts)

  1. grosbouff
    Posted 8 years ago #

    Hello; I'm building a custom menu with highlighting of the items, etc.

    All is working fine when the user is browsing pages or categories. (I use conditions like "if (is_category('cat1'))", etc.)

    The problem is that it's difficult for posts :
    a post can be attached to several categories, so it's hard to highlight the one I want...

    My idea was to use
    split it and isolate the $cat var.

    But the problem is that, when you click on a post, the content of $_SERVER['REQUEST_URI']; is not the previous page but the actual one (I guess it's because of the wordpress template system).

    So, is there another way to proceed ?
    Thanks !

  2. moshu
    Posted 8 years ago #


    It's true, it should work where the user IS, not where he was.

Topic Closed

This topic has been closed to new replies.

About this Topic