neilgee
2/24/2014 - 2:37 AM

WordPress onPage Loop - Certain Cat Infinite Posts

WordPress onPage Loop - Certain Cat Infinite Posts

<?php 
// args
$args = array(
	'cat' => 14,
	'numberposts' => -1
);
// get results
$the_query = new WP_Query( $args ); 
// The Loop
?>
<?php if( $the_query->have_posts() ): ?>
	<ul>
	<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
		<li>
			<div class="entry">  
			<div class="entry-thumbnail">
			<a href="<?php echo the_field('media_source_link') ?>" class="lbp_secondary" target="_blank"> 
				<?php if ( has_post_thumbnail() ) 
					{ // check if the post has a Post Thumbnail assigned to it.
						the_post_thumbnail();
					} 
				?> 
			 </a>
			 </div>
			<p class="entry-title"><a href="<?php echo the_field('media_source_link') ?>" rel="bookmark" title="Permanent Link to <?php echo the_field('media_source_link') ?>" target="_blank"><?php the_title(); ?></a></p>
			<div class="entry-excerpt">
				<?php the_content(); ?>
			</div>
			<a href="<?php echo the_field('media_source_link') ?>"  target="_blank"><img src="<?php bloginfo('url'); ?>/wp-content/themes/hello/images/READMORE.png" class="readmore-media" /></a>
			<br class="clear" />
		   <div class="social-share"> <?php if(function_exists('kc_add_social_share')) kc_add_social_share(); ?></div>
		   
			<br class="clear" />
		</div>
		<br class="clear" />
		</li>
	<?php endwhile; ?>
	</ul>
<?php endif; ?>
<?php wp_reset_query();  // Restore global post data stomped by the_post(). ?>