Support » Fixing WordPress » How do I create a page that is linked to from the navbar at the top of my theme

  • I’m totally new. Just installed last night. some themes have navigation links at the top that lead to “about” and “archive.” when I click on these links, they take me to a page “www.jeffreyclong.com/about” or http://www.jeffreyclong.com/archive which are 404 errors. What am I supposed to do to fix this? Creating a page “about” or “archive” doesn’t use those urls.

Viewing 8 replies - 1 through 8 (of 8 total)
  • That’s because you are using the default permalink structure and those links are hard coded in the navbar.

    So do I need to edit the theme?

    For instance, if you look in the nav you’ll see the link to your “about” page is hard coded as /about but the actual location (URL) is /?page_id=346. See what I mean? You can either manually edit the links in the nav or change your permalink structure to use pretty permalinks.

    Thank you. Just to be clear when you say “in the nav” you mean the nav area of the theme editor right? I just bought WordPress for dummies. Don’t know if it’s going to address this.

    In header.php the links at the top of your page are contained within a UL ID called “nav”.

    Your about page is hardcoded as,
    <?php bloginfo('url'); ?>/about/">

    But that’s not the actual URL because of the permalink structure you’re using.

    k. thanks

    How do I create a page that is linked to from the navbar at the top of my theme

    First create a new page and save it. For the sake of example, lets call your new page “Apples”. You are using cutline, so you will have to open header.php and locate this:

    <ul id="nav">

    Directly below that, you will see the code that obviously creates your FrontPage, Archive and About links.

    Add this line…

    <li><a <?php if (is_page('apples')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/apples/">apples</a></li>

    …to the existing lines that describe your about, frontpage, and archive pages. Note that where you position the new entry (first, second, third, or last in line)will be reflected in where the new page title appears in the header.

    This should give you a new page tab that links to your new page titled “Apples”.

    I just confirmed on my test box that this does in fact work. I used this version of cutline,

    http://www.tubetorial.com/downloads/Cutline_1pt2.zip

    Both the archive and the about pages also worked correctly with no 404’s.

    … and as suggested by Lenk, you will need to investigate the use of “pretty permalinks”.

    Best of luck to you.

    Cj.

    Anyone can elaborate the method detailly?
    Where to edit the page?

    IE can find the archives folder, for example.

    Many thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How do I create a page that is linked to from the navbar at the top of my theme’ is closed to new replies.