Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other [Solved] WordPress- How to link a main nav to an external link?

  • This topic is empty.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #30529
    noahgelman
    Participant

    Title pretty much says it all. I have a main nav item (a page created to create the nav) but I want it to link externally. How would I do that?

    #78279
    keithdevon
    Member

    What version of WP and theme are you using?

    #78267
    Bob
    Member

    Exactly what do you mean, link externally? As in, link to for example Google? I must not understanding this question, but can’t you just do it like:

    Click here for an external link
    #78235
    noahgelman
    Participant

    I’m using a custom theme.


    @bob
    , I can’t just put a link there, the links are generated by created pages.

    #78245
    noahgelman
    Participant

    Thanks for the suggestion. I’ll try it out when i get home and give an update then

    #78135
    SFD
    Member

    Noah, use WP Menubar. It is incredibly flexible and will allow you to do exactly what you are asking for, and much more.

    http://wordpress.org/extend/plugins/menubar/
    http://www.blogsweek.com/wp-menubar-3-documentation/

    #78138
    jamygolden
    Member

    Could you paste the nav’s php? – Perhaps I can see what’s going on there :p

    #78126
    noahgelman
    Participant
    
    

    if (is_home()) {

    $addclass = ' class="current_page_item"';

    } else {

    $addclass = '';

    }

    wp_list_pages('sort_column=menu_order&title_li=');
    ?>

    This is my nav’s php

    #78042
    jamygolden
    Member

    That spits out <li> elements. So this should work:

    
    

    if (is_home()) {

    $addclass = ' class="current_page_item"';

    } else {

    $addclass = '';

    }

    wp_list_pages('sort_column=menu_order&title_li=');
    ?>
  • Example
  • #77920
    noahgelman
    Participant

    Yeah. I know I could do that but that would put it at the end and I need it third from last. If I go to the admin panel to order the links, can I order them around it?

    #77924
    jamygolden
    Member

    The links can be arranged in any order through the admin panel (WordPress 3) – Even external links. However the theme has to support it.

    Or what about:

    
    

    if (is_home()) {

    $addclass = ' class="current_page_item"';

    } else {

    $addclass = '';

    }

    wp_list_pages('sort_column=menu_order&title_li=&exclude=344,655,777');
    ?>
  • Example

  • #77931
    noahgelman
    Participant

    The first loop excludes the three posts, the second includes them, but doesn’t that second one also include all the ones in the first loop as well? You’d be duplicated nav links right?

    I suppose if worse comes to worse I can just take out the loops and just put in hard code list items.

    #77932
    jamygolden
    Member

    I would edit the theme and enable the WordPress 3 menu editor. (I haven’t actually gone through that tutorial, I just googled it quickly)

    #77954
    noahgelman
    Participant

    Well, there have definitely been several suggestions that can get the desired affect so I’ll mark this as solved

Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘Other’ is closed to new topics and replies.