WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Blog posts not showing up on blog page (5 posts)

  1. holbri
    Member
    Posted 1 year ago #

    Hello all,

    I am new to wordpress and php. I built a custom theme using a static front page. My designated blog page is not showing posts. It does however create a new page.

    My blog is directed to page-lounge.php

    I am using conditional templates for all the pages. I pasted below the code for the blog page. All of my static pages are working.

    Thank you in advance for your help!

    <?php 
    
    	/* Template name: Lounge Page */
    
    ?>
    
    <?php get_header(); ?>
    
    	<?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    		<h2 id="post-<?php the_ID(); ?>">
    <a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <?php the_title(); ?></a></h2>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
    			<div class="entry">
    <?php the_content('Read the rest of this entry »'); ?>
    </div>
    			<p class="postmetadata">
    Posted in <?php the_category(', ') ?>
    <strong>|</strong>
    <?php edit_post_link('Edit','','<strong>|</strong>'); ?>
    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    
    	<?php endwhile; ?>
    
    	<<div class="navigation">
     <div class="alignleft"><?php previous_posts_link('« Previous Entries') ?></div>
     <div class="alignright"><?php next_posts_link('Next Entries »','') ?></div>
     </div>
     <?php else : ?>
     <h2 class="center">Not Found</h2>
     <p class="center">
    <?php _e("Sorry, but you are looking for something that isn't here."); ?></p>
     <?php endif; ?>
    
    <?php get_sidebar('lounge'); ?>
    
    <?php get_footer(); ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still - use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    My blog is directed to page-lounge.php

    Assuming your have configured WP to use a static front page via Settings -> Reading, your main posts (blog?) page will be using your theme's index.php template file.

  3. holbri
    Member
    Posted 1 year ago #

    Thanks esmi
    My settings for reading is static front page to home in menu. My homepage is page-home.php

    Posts still do not publish to page-lounge.php (my blog)

    Here is the permalink I get for test post
    http://localhost/2012/10/24/test-post/

    I would like the post to publish to localhost/lounge/2012/10/24/test-post

    code for index.php is the same as page-lounge.php

    any ideas? Please let me know which code would be helpful to share. My site is on localhost.

    Thanks, Brian

  4. holbri
    Member
    Posted 1 year ago #

    ok, it was a combination of my permalinks , settings for reading posts and my home.php was the php code from my static front page and not my blog page.

    Newbie errors...thank you again for your help.

    Brian

  5. holbri
    Member
    Posted 1 year ago #

    needed to mark this resolved...Brian

Topic Closed

This topic has been closed to new replies.

About this Topic