Forums

[resolved] How to add Categories AND pages to navigation bar? (5 posts)

  1. biggamer3
    Member
    Posted 2 years ago #

    in my theme Mystique there is only an option for either Categories or Pages, i want to have some pages and some categories, how can i do this?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Have a look at this solution.

  3. biggamer3
    Member
    Posted 2 years ago #

    thanks a lot, trying it out now!

  4. Joshua Russak
    Member
    Posted 2 years ago #

    That solution doesn't work with the way Mystique set up its navigation.

    Simply put, if you want to display both PAGES and CATEGORIES, it takes 2 steps:
    STEP 1: Go to Mystique Settings > Navigation and set "Top Navigation Shows" to Pages. Click Save

    STEP 2: Go to Header.php file and find the following...

    echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><span class="title">$3</span><span class="pointer"></span>', wp_list_pages('echo=0&orderby=name&title_li=&exclude='.get_mystique_option('exclude_pages'))); endif;?>

    Right before the "endif;?>" paste in the following code...

    echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><span class="title">$3</span><span class="pointer"></span>', wp_list_categories('show_count=0&echo=0&title_li=&exclude='.get_mystique_option('exclude_categories')));

    That should work. Good luck!

  5. Joshua Russak
    Member
    Posted 2 years ago #

    CORRECTION: The theme has been recently updated. As a result, here's the new fix:

    Find

    mystique_list_pages(array('exclude' => get_mystique_option('exclude_pages'), 'sort_column' => 'menu_order'));
    and paste before the endif;?> the following...

    mystique_list_categories(array('hide_empty' => false, 'exclude' => get_mystique_option('exclude_categories')));

Topic Closed

This topic has been closed to new replies.

About this Topic