Forums

Getting pages to (easily) display in the menubar (5 posts)

  1. jseliger1
    Member
    Posted 9 months ago #

    Hi,

    I maintain http://blog.seliger.com and am having a rather frustrating problem. I want to create a new link in the menu bar at the top that says "Acronyms," right next to the links that say "Front page" "Archives" and "About." Since I probably added the link that says "About" at some point in the distant past, there must be some non-difficult way to accomplish this. But I can't figure out what it is in Wordpress 2.7.

    As shown here: http://www.flickr.com/photos/35682104@N05/3305939186/ , I've created the acronyms page. But the help file on "Pages" that's here: http://codex.wordpress.org/Pages wants me to edit a bunch of code that I'm likely to screw up along the way.

    Question 1: Is there a way to easily add a link that says "Acronyms?"

    Question 2: If not, do I need to try following the instructions here: http://codex.wordpress.org/Template_Tags/wp_list_pages .

    Sub-part to Question 1: If not, that ought to be added to whatever version of Wordpress is up next.

    Thanks in advance for any help!

  2. VelvetBlues.com
    Member
    Posted 9 months ago #

    Are you sure that you published the page? It should automatically show up for that theme unless you've ever edited the code...

    If so... what is the url to the new page?

  3. stvwlf
    Member
    Posted 9 months ago #

    Hi

    First you must create a new Page. You probably don't need to do any of the stuff on the codex Pages page. Just create a new page, give it the name Acronyms, and publish it. Then refresh your browser window on your home page.

    If you see the link for Acronyms in the nav line, your theme is probably using wp_list_pages to generate its nav. The only thing you might need to do is change the page order value so it appears in the place you want it to in the nav line. In other words, if you want it after About, see what number About has as its page order value, and make the number for Acronyms higher than that one.

    If you do not see the new link, your theme probably has its Nav manually coded. So open up header.php and look for a

    • list, where each nav item is an
    • item. Copy one of the existing ones, paste it in below About, and change it to the new acronyms page. If your page title is Acronyms, the default URL (page-slug) will be acronyms
  4. stvwlf
    Member
    Posted 9 months ago #

    Hi - the forum software just mangled part of my answer - let me restate the last part

    If you do not see the new link, your theme probably has its Nav manually coded. So open up header.php and look for a <ul><li> list, where each nav item is an <li> item. Copy one of the existing ones, paste it in below About, and change it to the new acronyms page. If your page title is Acronyms, the default URL (page-slug) will be acronyms

  5. jseliger1
    Member
    Posted 9 months ago #

    Hi — Thanks very much for your answers. I'm using the cutline three-column split theme, although its website at http://cutline.tubetorial.com/ doesn't appear to be live at the moment. In any event, cutline appears to use wp_list_pages or something like it to generate the list:

    <li><a <?php if (is_home()) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>">front page</a></li>
    		<li><a <?php if (is_archive() || is_page('archives')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/archives/">archives</a></li>
    		<li><a <?php if (is_page('about')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/about/">about</a></li>

    But, based on stvwlf's comments, I just hard-coded the URL to http://blog.seliger.com/acronyms in:

    <li><a <?php if (is_page('about')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/about/">about</a></li>
    		<li><a href="http://blog.seliger.com/acronyms">acronyms</a></li>

    And it now appears to work, although I suppose this might be a problem in the future. At the moment, however, it works.

    If so... what is the url to the new page?

    I changed it from the default to http://blog.seliger.com/acronyms .

Reply

You must log in to post.

About this Topic