I’m having issues getting blog posts to show on a custom template page.
I’m using the following:
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></ a></div> Posted in <?php the_category(', ') ?> by <?php the_author() ?> on <?php the_time('F jS, Y') ?> | <?php edit_post_link('Edit', '', ' | '); ?><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <?php endwhile; ?> <?php posts_nav_link(); ?> <?php else : ?> <h2>Not Found</h2> <p><?php _e("Sorry, no posts or pages could be found. Why not search for what you were trying to find?"); ?></p> <?php get_search_form(); ?> <?php endif; ?>
I’ve tried a few different ways and nothing has worked for me.
I just don’t see what is wrong?
I’m getting the following to output:
Posted in by admin on September 18th, 2011 | Edit | No Comments”
So basically, it’s outputting the title of the page: “BLOG” and it’s giving me who posted and when, but the odd thing is that the meta data isn’t for any real blog post. I have two test blog posts published to test with this, and neither of them will show, just this weird metadata that’s not even for either one of the blog posts.
Can anyone help me? Thank You!
- The topic ‘Trouble Display Loop on Custom Templage Page’ is closed to new replies.