• Resolved andy-with-love

    (@andy-with-love)


    Hi
    I got a question

    I want to display a menu depending on which “term_taxonomy_id” the page is attached to.

    My question is, how do I write this little script?

    Something like this?

    <?php if term_taxonomy_id =1,2,3,4
    menu 1
    
    else
    menu 2 ?>

    im using the CataBlog plugin so thats where the “term_taxonomy_id” come from.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andy, try this

    <?php if (term_taxonomy_id == 2): ?>
      menu 1 code
    <?php else: ?>
      menu 2 code
    <?php endif ?>

    Now I’m not sure if term_taxonomy_id has a value in WordPress, there are ways to use the query variables though to find what the taxonomy id is. But the above example will definitely create a conditional menu that can show different menus at different times.

    Thread Starter andy-with-love

    (@andy-with-love)

    hmm it does not work, unfortunately, not with “term_taxonomy_id” Do you know any other value that I can try?

    Thread Starter andy-with-love

    (@andy-with-love)

    Got it!
    ??

    Andy, if you could describe how you got it here you might help out others and contribute to the community. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Menu depending on which category the page is attatched to’ is closed to new replies.