WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Two home pages in WP 2.1 (5 posts)

  1. samuelclarke
    Member
    Posted 7 years ago #

    Have just upgraded to WordPress 2.1 and really excited about the simple static home page feature - I was just about to delve into the code to set up a static home page for a client, and this update came just at the right time! :-)

    Anyway, I've got the front page set to a page called "home" (static page) and the loop set to a page called "news". Everything is fine except for the fact that there are two "home" links in the menu (they both go to the same page) - what's the story and how can I fix it so that there is only one "home" in the menu bar?

    Thanks in advance for the help! I'm starting to understand a little PHP code, but I've been a print designer and while my CSS and HTLM are almost passable, my PHP isn't!!

  2. Tdude
    Member
    Posted 7 years ago #

    Hi!
    Check your theme's header.php. It could be the "Home" link is hardcoded there.

    You could also set your "home" page's title to nothing...uhmm null, zilch, you know, blank.
    All the best,
    T

  3. samuelclarke
    Member
    Posted 7 years ago #

    Thanks for that! After looking in the header.php file I found that it wasn't a variable (i.e. was hardcoded)

    My PHP skills are still getting there - I had a look in there but at first glance didn't see anything amiss...but hey, I've learned something new - so thanks! :-)

  4. samuelclarke
    Member
    Posted 7 years ago #

    Thanks for that! After looking in the header.php file I found that it wasn't a variable (i.e. was hardcoded)

    My PHP skills are still getting there - I had a look in there but at first glance didn't see anything amiss...but hey, I've learned something new - so thanks! :-)

  5. jankdc
    Member
    Posted 7 years ago #

    I am having the same problem. But I still don't understand what to do. Here is some code in my header.php file. Let me know what I should change.

    <h1><a href=\\"<?php echo get_settings('home'); ?>\\"><?php bloginfo('name'); ?></a></h1>
    
    <h2><?php bloginfo('description'); ?></h2>
    
    </div>
    
    <?php if (is_page()) { $highlight = \\"\\"; } else {$highlight = \\"current\\"; } ?>
    
    <div id=\\"mainmenu\\">
    <ul class=\\"level1\\">
    <li class=\\"<?php echo $highlight; ?>\\"><a href=\\"<?php echo get_settings('home'); ?>\\"><?php _e('Home','andreas09'); ?></a></li>
    <?php
        if(function_exists(\\"wp_andreas09_nav\\")) {
          wp_andreas09_nav(\\"sort_column=menu_order&list_tag=0&show_all_parents=1&show_root=1\\");
        }
    ?>
    </div>

    Thanks

  6. Tdude
    Member
    Posted 7 years ago #

    You've probably found it by now, but it's probably the word "Home" and the single quotes around it that has to go because you have a page called "Home" too.

    <li class=\\"<?php echo $highlight; ?>\\">\\"><?php _e('Home','andreas09'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags