WordPress.org

Forums

Conditional Menu for Posts Within Category (2 posts)

  1. pinkhairedpixel
    Member
    Posted 1 year ago #

    Hi,

    I need to display a different menu for a certain category AND posts within that category. I have been looking for a code or plugin (although I would rather use code) and can't seem to find something that will display the new primary nav for posts within the category, only the category page itself. I tried this code and it did nothing.

    <?php
    if(has_nav_menu('primary'))
    {
    }
       if(is_category(meijer-2)){
        $locationMenu=meijer
    ?>
    <?php
                    wp_nav_menu( array(
    			'menu' => $locationMenu,
                            'theme_location'=> 'primary',
                            'container'     => false,
                            'menu_id'       => 'nav',
                            'fallback_cb'   => 'wp_page_menu'
                        ) );
    } else
    ?>
  2. pinkhairedpixel
    Member
    Posted 1 year ago #

    bump anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic