...

View Full Version : Resolved WordPress Loop Issues



particlepat
07-02-2009, 04:48 PM
I'm having some issues writing the loop for my wordpress site (http://www.bcsprosoft.com/blog). There will be a static homepage that will contain the header, footer, top navigation bar, a containing holding some navigation buttons that will only be visible on the home page, and then a smaller container to the right of that one that will hold a small snippet/excerpt of my most recent blog post.

I am starting to get really frustrated when I try to write the loop for the single blog post. I want to show the blog title that links to the post, the authors name, the excerpt, a link that says "Read the rest of this entry", the number of comments, and a link to leave a comment. I do not want a list of comments to appear on the homepage though.

I have been able to get the title, the authors name and an excerpt of the blog, but it shows an excerpt for all of my entries, and like I said, I only want one. Can someone please give me some pointers or help me write the code for my loop?

*I will have a separate page designated to showing all blog posts, so I'm assuming that will be a completely different loop. I'm only focused on the first loop as of now.

particlepat
07-02-2009, 06:29 PM
If anyone searches this post i the future, my original code was:


<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

<div class="post">
<h1 class="toptitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<p class="topMeta">by <?php the_author_firstname(); ?> <?php the_author_lastname(); ?></p>

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

</div> <!-- Closes post --><br />

<?php endwhile; ?>

<?php endif; ?>


I was able to display a single post by adding
<?php query_posts('showposts=1') ?> before the rest of the loop.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum