Support » Fixing WordPress » Problem with the loop

  • Resolved ehab


    Hi all.

    this is the code my theme uses for the loop in the home page. It displays one post from one catagory only.

    by default, the catagory in the code is set to one. There is no posts in that. And the site appears correct. ( nothing appears where the posts is supposed to.. )

    But, when I put category as 3, where there is the post, the site gets broken – Just after the Permalink to the post appears.

    Check it out please.

    Here is the LOOP CODE

    <h2>Bangladesh News</h2>
    			<?php $recent = new WP_Query("cat=3&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
    			<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
    			<?php the_content_limit(130, ""); ?>
    			<div class="hppostmeta">
    				<p><?php the_time('F j, Y'); ?> | <a href="<?php the_permalink() ?>" rel="bookmark">Read the story &raquo;</a></p>
    			<?php endwhile; ?><br />
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with the loop’ is closed to new replies.