Created
July 11, 2012 06:08
-
-
Save andrastudio/3088277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$exclude_cat = stripslashes( get_option($shortname.'_exclude_cat_latest_news') ); | |
// Remove any space | |
$exclude_cat = str_replace(' ', '', $exclude_cat); | |
// Explode the string into array | |
$exclude_cat = explode(',', $exclude_cat); | |
$latest_news_total = stripslashes( get_option($shortname.'_latest_news_total') ); | |
// Start fetching content | |
$args = array('showposts' => $latest_news_total, 'category__not_in' => $exclude_cat, 'paged' => $paged); | |
query_posts($args); | |
if (have_posts()) : | |
?> | |
<!-- START: LATEST POSTS --> | |
<div id="latest-posts" class="clearfix"> | |
<div class="caption"> | |
<h3 class="title"><?php _e('Latest Articles', 'warrior'); ?></h3> | |
</div> | |
<?php | |
while (have_posts()) : the_post(); | |
?> | |
<div id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>> | |
<h2 class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> | |
<?php warrior_post_info(); ?> | |
<div class="thumb"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php warrior_thumbnail( 'both', '100', '100', 'post-thumb', get_the_title()); ?></a></div> | |
<p><?php echo warrior_excerpt('300'); ?></p> | |
</div> | |
<?php | |
endwhile; | |
?> | |
</div> | |
<!-- END: LATEST POSTS --> | |
<div class="navigation clearfix"> | |
<?php previous_posts_link(__('« Previous', 'warrior')); ?> | |
<?php next_posts_link(__('Next »', 'warrior')); ?> | |
</div> | |
<?php | |
endif; | |
wp_reset_query(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment