Word Press Blog loop goes away when I pick a static front page

Posted on 2007-10-09
Last Modified: 2008-03-03
am having a wordpress issue.  I installed the newest version 2.3.  I also uploaded a theme - cutline.  
I added some new pages such as about, services, portfolio, and a page I named home.
In options, reading - I changed things to use a static page as the "front page", and I picked the one i named home to be the front page.

So here is my issue.  I renamed the one that had said Front Page to blog.

If I keep the option for a static front page, the blog link becomes identical (or actually is) the "home" page with no entries for a blog.  If I uncheck that option, then the blog link (and page)  displays blog entries.

Here is where my changes were made, inside of header.php - for display of the menu on top.  These changes were made in addition to making the changes in the admin area for a static home page.    I hope someone can help me out!!

<ul id="nav">
        <li><a <?php if (is_page('home')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/home/">home</a></li>
            <li><a <?php if (is_page('about')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/about/">about</a></li>
        <li><a <?php if (is_page('services')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/services/">services</a></li>
        <li><a <?php if (is_page('portfolio')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/portfolio/">portfolio</a></li>
        <li><a <?php if (is_page('contact')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/contact/">contact</a></li>
        <li><a <?php if (is_home()) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>">blog</a></li>
            <li class="rss"><a href="<?php bloginfo('rss2_url'); ?>">RSS</a></li>
Question by:linque
    LVL 13

    Accepted Solution

    I think I can see what you were trying to do. The idea is clever - basically build a website in Wordpress, where the blog is not the left-hand link in the homepage, thereby minimizing its significance to the site. Wordpress does allow you to do this, but it's not intuitive.

    First, reload your original header, but remove this line (or it's equivalent in your theme):
    <li <?php if(is_home()){echo 'class="current_page_item"';}?>><a href="<?php bloginfo('siteurl'); ?>" title="Home">Home</a></li>

    Next, create an empty page from the "Write Page" menu and name it "Blog". In the right-hand list of options, give it a category slug of "blog" and a page order of 1 (this moves it to the right-hand side of your links).

    To make sure that your new static "home" page appears to the left of the other links, give it a page order of -1. You can do this by edit that page through the manage tab.

    In the Options tab, click the "Reading" submenu and choose the option to make a static page your homepage. Select the "home" page for your front page, and select the empty "blog" page your posts page.

    Next go to the Permalinks submenu (also under Options) and select the custom option for your permalink structure. Type "/%postname%" in that input field. Hopefully that'll accomplish what you wanted.

    If that still doesn't work, you may need to enable mod_rewrite for your server. If you run Apache I may even be able to walk you through that. If you run IIS, there's a plugin you can install on your blog to make it work.

    Author Comment

    IT WORKED!!!!!!!!


    But I just discovered something about this.  I added a new post, and when I click the blog link (I added a new one to my list in the header now that's
      <li><a <?php if (is_page('blog')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/blog/">blog</a></li>

    in order to have a link at the top

    Now older posts show up, but I just added one, it took the tile as a slug, and it does not show up with the older posts.  It's "published" - and it is available at
    but it's not available when I simply click "blog" at the top..   hmmmm  

    p.s.  I also updated the .htaccess when I changed the permalinks as I was instructed to do.
    LVL 13

    Expert Comment

    I don't know why that would happen. I tested the same approach on my own blog and the new post showed up fine. However, I did not manually add the blog page to my header file. I wonder if this function from the original header actually updated the page before displaying:
    <?php wp_list_pages('title_li=&depth=1');?>

    Try doing what I recommended earlier and reload your original header file. Just take out that one line that creates a link to your homepage. See if that fixes it for you.

    Author Comment

    Hi MasonWolf,

    I took the line out.  When I surf to my site I'm still not seeing any new posts.  Of interest, as well..  
    when I  open the existing page above, I see one of the 2 original posts on the blog.  at the top, there is a "breadcrumb" sort of thing.  It says "2nd post".  If I click it, I get the 2nd post, but the breadcrumb thing now shows two other *pages* going forward or back - which happen to be "services" or "interiors" - I'm not sure what the implications of this are.   Maybe I need to start all over??
    LVL 13

    Expert Comment

    Just so I understand you, you're saying that you did reload your original header first?

    What's your actual URL so I can see what you're describing?

    Author Comment

    http:// www oscar hertz interiors . com   (no spaces)

    Author Comment

    oh - yes - i reloaded the header.php without the line, as you had suggested
    LVL 13

    Expert Comment

    I think what happened is that you have your first post's slug set to "blog". Since both the blog page and the first blog post are being returned when WP retrieves content from the database, it's just a question of which result comes back first. If that's right, then it's simply that the post came back first and so that's what your link brought back. As for the screwy navigation links from the second post, I'm really not sure what would cause that.

    Anyway, the solution, I think, is to revise your permalinks. Try using "/%postname%/%post_id". If I was right about the problem, that should fix it for you. This will make sure that even if you have multiple items mapping to the same %postname% value, you won't have ambiguity in your link destination.

    Author Comment

    I went to your profile, and sent a message from your info there.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    PHP Word Writer 1 29
    Joomla main HTML page 4 19
    Impossible arithmetic 8 33
    getting checkbox data form a html - php form 5 31
    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now