WordPress.org

Forums

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

  1. jeffreyclong
    Member
    Posted 7 years ago #

    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.

  2. Len
    Member
    Posted 7 years ago #

    That's because you are using the default permalink structure and those links are hard coded in the navbar.

  3. jeffreyclong
    Member
    Posted 7 years ago #

    So do I need to edit the theme?

  4. Len
    Member
    Posted 7 years ago #

    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.

  5. jeffreyclong
    Member
    Posted 7 years ago #

    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.

  6. Len
    Member
    Posted 7 years ago #

    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.

  7. jeffreyclong
    Member
    Posted 7 years ago #

    k. thanks

  8. ClaytonJames
    Member
    Posted 7 years ago #

    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.

  9. Anonymous
    Unregistered
    Posted 6 years ago #

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

    IE can find the archives folder, for example.

    Many thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic