• Resolved George Moureau

    (@georgepiccexcellencecom)


    Hello,
    I’ve been tasked with moving our blog from the home page. I’ve converted the home page to and “about” page, added a menu item for the blog, created the necessary templates and pages and changed the settings for “Reading” in WordPress. link is http://www.piccexcellence.com.

    The home page works a it should however the blog page displays the home page rather than the blog. In “Reading Settings” I’ve set the front page to be a static page, “Front Page: Home Page”, “Posts Page: Blog Page”. When I change it back to “Front Page displays your latest posts”, the front page behaves as it should, the blog page pulls up the blog template however no “latest” posts are displayed, instead I get a “not found” message. There is an “if:while:else” loop that fails on the “get_posts” function. Can’t figure out why.

    Thanks,
    George

Viewing 13 replies - 1 through 13 (of 13 total)
  • Couple of questions:

    1. What theme are you using?
    2. Does it have a home.php file?
    3. Did you edit the theme template files? If so, which ones?

    I think you have to rewrite your posts (blog) url to /blog-page/%postname%/

    I trust that all the posts are still being rendered by the old permalink. Please advise if this did not work.

    Thread Starter George Moureau

    (@georgepiccexcellencecom)

    Shaun, I’ve built a custom theme which has been working with no problems and yes it has a home.php and no I created my own theme template files.

    Archie, I’ll look in to this, sounds like a good lead. We created a large number of posts with the former permalink…

    Thanks,
    George

    @george@piccexcellence.com: As per the Forum Welcome, please post your own topic. Posting in an existing topic prevents us from being able to track issues by topic. Added to which, your problem – despite any similarity in symptoms – is likely to be completely different.

    @esmi: George was the original poster of this topic; I think you may have it mixed up with another thread.

    @george: Add the code below to your footer.php and look at your blog page. Copy & paste the results that appear in the footer, then go back and remove the code.

    <?php
    global $wp_query;
    echo get_post_meta( $wp_query->post->ID, '_wp_page_template', true );
    ?>

    This will tell you which page template is being used on your blog page. It should be using home.php, but it’s possible with your custom theme that something else is getting loaded instead.

    Thread Starter George Moureau

    (@georgepiccexcellencecom)

    Thanks Shaun, will give it a try and let you know. As far as I can tell I am using home.php for the blog page. At this point, the blog page presents, I have the category list displayed, however none of my existing posts are listed below. It fails the “if (have posts())” conditional. http://www.piccexcellence.com – “our blog” is the menu item top right…

    George

    Thread Starter George Moureau

    (@georgepiccexcellencecom)

    Ah, another clue to the mystery. Added the code to the footer and it works….on all pages except the blog page. I don’t get a return from the get_post_meta function call on the blog page only…. curious…

    G.

    Are you using query_posts() anywhere in your template?

    Thread Starter George Moureau

    (@georgepiccexcellencecom)

    yes, below is the code. It’s pretty standard. I believe it came with WordPress templates.

    <?php query_posts($query_string . “posts_per_page=6”);?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>

    <h4>“><?php the_title(); ?></h4>

    <!–DISPLAYS THE POSTED ON DATE AND PERSON –>

    <?php include (TEMPLATEPATH . ‘/inc/meta.php’ ); ?>

    <div class=”entry”>
    <?php the_excerpt(); ?>

    </div> <!– end entry div –>
    </div> <!– end post div –>

    <?php endwhile; ?>

    <?php include (TEMPLATEPATH . ‘/inc/nav.php’ ); ?>

    <?php else : ?>
    <h2>Not Found </h2>
    <?php endif; ?>

    Try getting rid of that first line of php:

    <?php query_posts($query_string . "posts_per_page=6");?>

    Thread Starter George Moureau

    (@georgepiccexcellencecom)

    That did it! Thanks Shaun. That wouldn’t have occurred to me but now that I think about it, it was redundant. Thanks man, I owe ya one…

    George

    No problem, glad I could help.

    evil === query_posts()

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Blog Posts "Not Found" when moving blog from front page’ is closed to new replies.