Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question WordPress Loop Issues

    I'm having some issues writing the loop for my wordpress site. 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.
    Last edited by particlepat; 07-02-2009 at 06:29 PM. Reason: topic resolved

  • #2
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    If anyone searches this post i the future, my original code was:
    Code:
    <?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
    Code:
    <?php query_posts('showposts=1') ?>
    before the rest of the loop.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •