Below is the code for my latest articles, this is located on index.php. I want to have all posts from all categories here but with the offset of 5 for news, reviews, and featured.
<!-- Latest Articles // -->
<span class="heading2"><span><?php echo $_GET['paged'] ? 'Page'.$_GET['paged'] : 'Latest Articles'; ?></span></span>
<ul class="articles">
<?php while (have_posts()) : the_post(); ?>
<li id="post-<?php the_ID(); ?>">
<a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<span class="pinfo">
<a class="comments" href="<?php the_permalink() ?>#comments"><?php comments_number(__('0'), __('1'), __('%')); ?> Comments</a>Posted by <?php the_author_posts_link() ?> on <?php the_date(); ?> under <span><?php the_category(', ') ?></span>
</span>
<?php if(get_post_meta($post->ID, "thumbnail", true)) : ?>
<a href="<?php the_permalink(); ?>" class="thumb"><img src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" /></a>
<?php endif; ?>
<div class="post">
<?php wpn_content_limit(get_the_content(),400); ?> <a href="<?php the_permalink(); ?>">more</a>.
</div>
<div class="clear"></div>
</li>
<?php endwhile; ?>
</ul>
<!-- // Latest Articles -->
Here for example is the code for the news section of the main page, this code is located in functions.php
class widget_wpn_latestp extends WP_Widget {
/** constructor */
function widget_wpn_latestp() {
parent::WP_Widget(false, $name = 'WP Now: Latest Previews');
}
/** @see WP_Widget::widget */
function widget($args, $instance) {
extract( $args );
global $wpdb,$post;
$latestp = new WP_Query("cat=1623,1630,1627,1624,1655,1656,1657&showposts=".$instance['limit']);
?>
<!-- Latest Previews // -->
<span class="heading2"><span><?php echo $instance['title']; ?></span></span>
<div class="box">
<ul class="latestrp">
<?php if($latestp->have_posts()) : ?>
<?php while($latestp->have_posts()) : $latestp->the_post();?>
<li>
<?php if(get_post_meta($post->ID, "thumbnail_small", true)) : ?>
<img src="<?php echo get_post_meta($post->ID, "thumbnail_small", true); ?>" />
<?php endif; ?>
<a href="<?php the_permalink(); ?>"><?php echo wpn_content_limit(get_the_title(),35); ?></a>
<span>Posted Under: <?php the_category(', '); ?></span>
</li>
<?php endwhile; ?>
<?php else: ?>
<li>No posts found</li>
<?Php endif; ?>
</ul>
</div>