Loop Question- Categories/posts
-
I am trying to loop more than one category on the homepage
like the first loop is events and has 4 poststhe second category i would like to feature is birthday packages
which is cat 4 and just display 1 postand the 3rd category is a news section with 2 posts in it
im trying to lay out the page like this mock
page mockupi know i have to put <?php rewind_posts(); ?> somewhere in the loop code but im getting confused..here is what i had
<?php rewind_posts(); ?>
<div class=”stor2″> </div>
<?php $my_query = query_posts(‘cat=4&showposts=1’); ?>
<?php if (have_posts()) : ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class=”box2″ id=”post-<?php the_ID(); ?>”>
<div class=”cover”>
<div class=”title”>
<h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h2>
</div>
<div class=”sentry”>
<?php $preview = get_post_meta($post->ID, ‘preview’, $single = true); ?>
” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><img class=”ethumb” src=”<?php bloginfo(‘stylesheet_directory’); ?>/timthumb.php?src=<?php echo $preview; ?>&h=150&w=150&zc=1″ alt=””/>
<?php the_excerpt () ?><div class=”clear”></div>
</div>
</div>
<div class=”sinfo2″>
<div class=”rmore”>” title=”Permanent Link to <?php the_title(); ?>”> CLICK HERE FOR INFO</div>
</div>and it broke my site so i had to erase it ..id appreciate if someone could point me in the right direction.
Many thanks
- The topic ‘Loop Question- Categories/posts’ is closed to new replies.