jruzafa
5/16/2013 - 5:29 PM

Loop the category and pagination with http://wordpress.org/extend/plugins/wp-pagenavi/

Loop the category and pagination with http://wordpress.org/extend/plugins/wp-pagenavi/

/*
*	http://www.imod.co.za/2009/07/13/shorten-wordpress-the_title-function/
*	http://wpcult.com/limit-the-characters-that-display-on-the_title/
*/

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

$args = array('posts_per_page' => 6, 'cat' => $wp_query->queried_object_id, 'paged' => $paged);

$query_post_category = new WP_Query( $args );

if ($query_post_category->have_posts()) : ?>
  		<?php while ($query_post_category->have_posts()) : $query_post_category->the_post(); ?>

<?php if($i++%3==0){echo '<div class="row-fluid row-post-category">';}?>

                  <article <?php post_class(array('post-category','span4')) ?> id="post-<?php the_ID(); ?>">
						<div class="row-fluid row-image-post-category">

							<figure class="image-post-category">
								<img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>"  />
							</figure>

						</div>
	                    <div class="row-fluid title-post-category">
							<div class="row-fluid">
									<time datetime="YYYY-MM-DD" class="date-post"><?php the_date('j F, Y'); ?></time>
							</div>

							<div class="row-fluid title">
								<h2>
									<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title_shorten(35); ?></a>
								</h2>
							</div>

							<div class="row-fluid">
								<div class="separador-post"></div>
							</div>

	                    	<div class="row-fluid">
	                    		<footer class="postmetadata">
	                    			<img src="<?php bloginfo( 'template_directory' ); ?>/img/icon-tag.png" />
		                        <?php the_category(', '); ?>

		                        <img src="<?php bloginfo( 'template_directory' ); ?>/img/icon-comment.png" />
								<?php echo get_comments_number(); ?>
		                    </footer>
	                    	</div>
	                    </div>
	                </article>

            <?php if($i%3==0 || $i==$query_post_category->post_count ){echo '</div>'; } ?>

			<?php endwhile; ?>
		<?php else : ?>

			<h2><?php _e('Nothing Found','html5reset'); ?></h2>

		<?php endif; ?>

		<div class="row-fluid">
			<?php wp_pagenavi(); ?>
		</div>