• I use wordpress blog as part of a site, and I want to use the mystique navbar to link the blog with the rest of the site. Now, I put pages on the navbar to have the proper title, but I don’t know how to redirect the navbar’s buttons to the rest of the site. So the question is: how can I change the link of the navbar buttons (using the pages)?

Viewing 9 replies - 1 through 9 (of 9 total)
  • My guess is the theme (as it is common) uses “wp_list_pages” for the nav bar. So you can just add normal links after that or even make the whole nav with html links

    Ex:

    <ul id="nabar">
      <?php wp_list_pages('child_of=20&exclude=13,151,148,501&sort_column=menu_order&title_li='); ?> <a href="https://yoururladdress">your link</a> </ul>
    Thread Starter elsatrento

    (@elsatrento)

    I ‘m sorry, I can’t find the wp_list_pages, where should it be?

    Check the header.php. The mystique theme has a very long code for its navigation buttons.

    The navigation code starts starts at <ul id="navigation"> and ends at </ul>.

    Before the </ul> and right after the “endif” php code, you can insert something like this code

    <li><a href="https://yoururladdress">your static link</a> </li>

    Below is the entire navigation block inside the header.php, notice the last few codes:

    <ul id="navigation">
    
             <?php
              $navtype = get_mystique_option('navigation');
              if((get_option('show_on_front')<>'page') && get_mystique_option('exclude_home')<>'1'):
               if(is_home() && !is_paged()): ?>
                <li class="current_page_item" id="nav-home"><a class="home fadeThis" href="<?php echo get_settings('home'); ?>" title="<?php _e('You are Home','mystique'); ?>"><span class="title"><?php _e('Home','mystique'); ?></span><span class="pointer"></span></a></li>
               <?php else: ?>
                <li id="nav-home"><a class="home fadeThis" href="<?php echo get_option('home'); ?>" title="<?php _e('Click for Home','mystique'); ?>"><span class="title"><?php _e('Home','mystique'); ?></span><span class="pointer"></span></a></li>
              <?php
               endif;
              endif; ?>
             <?php
               if($navtype=='categories'):
                echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><a class="fadeThis"$2><span class="title">$3</span><span class="pointer"></span></a>', wp_list_categories('show_count=0&echo=0&title_li=&exclude='.get_mystique_option('exclude_categories')));
               elseif($navtype=='links'):
    
                $links = get_bookmarks(array(
                'orderby'        => 'name',
                'order'          => 'ASC',
                'limit'          => -1,
                'category'       => null,
                'category_name'  => get_mystique_option('navigation_links'),
                'hide_invisible' => true,
                'show_updated'   => 0,
                'include'        => null,
                'search'         => '.'));
    
                foreach ($links as $link)
                 echo '<li><a class="fadeThis" href="'.$link->link_url.'" target="_blank"><span class="title">'.$link->link_name.'</span></a><li>';
    
               else:
                 echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><a class="fadeThis"$2><span class="title">$3</span><span class="pointer"></span></a>', wp_list_pages('echo=0&orderby=name&title_li=&exclude='.get_mystique_option('exclude_pages')));
               endif;
              ?>
    <li><a href="https://yoururladdress">your static link</a> </li>
          </ul>
    Thread Starter elsatrento

    (@elsatrento)

    Ok, I found the place you’re talking about, but I don’t know how to procede. You gave me the “youraddress” example, but how can I “tell” the theme that once I insert in the navbar a button as a link for one of the PAGES’s blog I want instead to redirect it to one of the page’s site? (I hope it’s clear, it get confusioned between the “PAGES” in wordpress and the “pages” of the rest of my site)

    Thanks or your help

    From the example I gave, you can replace the “yoururladdress” in

    <a href="https://yoururladdress">your static link</a>

    with any of your page url address outside WordPress.

    So we are not redirecting (I don’t think you need to) but creating or adding static links that are external to your blog.

    Now, I put pages on the navbar to have the proper title, but I don’t know how to redirect the navbar’s buttons to the rest of the site. So the question is: how can I change the link of the navbar buttons (using the pages)?

    This makes it simple. I’m using it right now on the Mystique theme to redirect page titles in the navbar to off-site urls as well as first child pages.

    https://www.ads-software.com/extend/plugins/page-links-to/

    Thread Starter elsatrento

    (@elsatrento)

    ClaytonJames, you saved my life (I’m terrible with coding…)! Thank you very much!
    Darttiglao, thanks to you too, you’ve been very kind ??

    You’re welcome.

    Thread Starter elsatrento

    (@elsatrento)

    Wait, I forgot the “Home” button! That one doesn’t figure out as page, and I like the icon the theme uses. I need to modify just that one. So, Darttinglao, I have to write that line you suggested me, substituing “yoururladdress” with the home blog page, and “your static link” with the address of my real home page. Is that right?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to modify page’s links in navbar in Mystique theme’ is closed to new replies.