• Resolved tylerjay

    (@tylerjay)


    Link – https://merveilleevents.com/journal/

    Code for page.php

    <?php get_header(); ?>
    
    <div id="sidebar">
    <?php get_sidebar(); ?>
    </div>
    
    <div id="content">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><?php the_title(); ?></h2>
    			<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    </div>
    
    <?php get_footer(); ?>

    Ive used this basic page.php successfully on other sites but for this site the posts are not displaying. Archives and category are displaying correctly however.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Maybe something in your sidebar causing a problem…if you move that just above get_footer does it work?

    Thread Starter tylerjay

    (@tylerjay)

    Unfortunately that doesnt fix it.

    Sidebar.php is bare as a baby’s bottom, unaltered from starkers.

    Try this before the loop– wp_reset_query();

    If that doesn’t fix, what about plugins?

    Tried the WordPress Default theme (which has a page.php very similar to the one you are using)?

    Thread Starter tylerjay

    (@tylerjay)

    Weird, posts arent showing under default theme with all plugins deactivated. Tried <?php wp_reset_query(); ?> before the loop with no luck. ??

    Any other ideas?

    Try deleting .htaccess then update your Admin->Settings->Permalinks.

    Thread Starter tylerjay

    (@tylerjay)

    I appreciate your help! It led me to find the culprit!
    Under Settings->Reading I had to designate “posts page” for my specified blog page because my front page is static.

    Yaaaaaay!

    Well, this is an old thread, but maybe somebody can still help me.
    I’m having a similar problem.

    I have a static page for my front page, and I have just created a new page for my blog posts. I have already gone to Settings > Reading, and from the second drop down box, selected my posts page.

    But the weird thing is, when I try to visit my posts page from the front end, it takes my to my homepage?? I have different templates assigned to each, and on my blog post template, I have the loop that I copied and pasted from page.php.

    If I go back to Settings > Reading, and don’t designate a page for my posts page at all, then go back to the front end of my site and visit the page, it uses the correct template. Of course it doesn’t show my blog posts, but I do see the rest of the loop (the comments box is there).

    Any help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Posts not displaying’ is closed to new replies.