help with this code
-
`<?php $posts = get_posts( “category=2&numberposts=3” ); ?>
<?php if( $posts ) : ?><div class=”post” id=”modernScience”>
<h2>Modern Science</h2>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<div class=”pleft”>
<h3 class=”entry-title”>” title=”<?php printf(__(‘Permalink to %s’), wp_specialchars(get_the_title(), 1)) ?>” rel=”bookmark”><?php the_title() ?></h3>
<div class=”entry-content”>
<?php the_content(“<span class=\”continue\”>” . __(‘Continue reading’,”) . ” ‘” . the_title(”, ”, false) . “‘</span>”); ?>
</div>
</div>
<div class=”pright”></div>
<?php endforeach; ?></div>
<?php endif; ?>
<?php $posts = get_posts( “category=3&numberposts=3” ); ?>
<?php if( $posts ) : ?><div class=”post” id=”lifestyle”>
<h2>Lifestyle</h2>-
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<div class=”pleft”>
<h3 class=”entry-title”>” title=”<?php printf(__(‘Permalink to %s’), wp_specialchars(get_the_title(), 1)) ?>” rel=”bookmark”><?php the_title() ?></h3>
<div class=”entry-content”>
<?php the_content(“<span class=\”continue\”>” . __(‘Continue reading’,”) . ” ‘” . the_title(”, ”, false) . “‘</span>”); ?>
</div>
</div>
<div class=”pright”></div>
<?php endforeach; ?></div>
<?php endif; ?>
what i want this to do is this:
display the latest post from the category in pleft
and then display the title of the next 5 posts from the category in pright
how would i do it to this code?
- The topic ‘help with this code’ is closed to new replies.