Ask your WordPress questions! Pay money and get answers fast! (more info)

How to Have Recent Number Count in Sticky Posts WordPress

Hi - this is the piece of code I am using to pull in some recent posts with the exception that if it is form the VIDEO category it gets a PNG on top. The issue is the number it is showing tends to not show the correct amount = to 12. I am wondering how do I get it to count in the STICKY POSTS?

<div id="video-grid">

<?php
query_posts( $query_string . '&posts_per_page=12' );
if( have_posts() ) : while( have_posts() ) :the_post();
if ( in_category('videos') ) { ?>

<div class="story-video">
<a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_directory'); ?>/img/video.png" class="v-icon" title="<?php the_title(); ?>"></a>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
<p><a href="<?php the_permalink(); ?>"><?php echo excerpt(12); ?> Read More</a></p>
</div>

<?php } else { ?>

<div class="story">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
<p><a href="<?php the_permalink(); ?>"><?php echo excerpt(12); ?> Read More</a></p>
</div>

<?php } ?>

<?php endwhile;endif; wp_reset_query();?>

<div class="clearer"></div>
</div>

Answers (1)

2013-03-09

Kiet Luong answers:

please try this:

<div id="video-grid">



<?php

query_posts( $query_string . '&showposts=12' );



if( have_posts() ) : while( have_posts() ) :the_post();

if ( in_category('videos') ) { ?>



<div class="story-video">

<a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_directory'); ?>/img/video.png" class="v-icon" title="<?php the_title(); ?>"></a>


<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>

<a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>

<p><a href="<?php the_permalink(); ?>"><?php echo excerpt(12); ?> Read More</a></p>

</div>



<?php } else { ?>



<div class="story">

<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>

<a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>

<p><a href="<?php the_permalink(); ?>"><?php echo excerpt(12); ?> Read More</a></p>

</div>



<?php } ?>



<?php endwhile;endif; wp_reset_query();?>



<div class="clearer"></div>

</div>


Jay comments:

I will test this and report back will be a delay from the weekend!


Jay comments:

I tested it and it appears to be working :)


Jay comments:

Not correcting the issue