query_posts function to show the post from a month
-
I m using the code
function mnthly_rndps( $atts ) { extract(shortcode_atts(array( 'monthnum' => '','id'=> '1' ), $atts)); //The Query query_posts('monthnum=' . $id . ''); //The Loop if ( have_posts() ) : while ( have_posts() ) : the_post(); echo ' <li><h3><a href="'; echo the_permalink(); echo '">'; echo the_title(); echo '</a></h3></li> '; endwhile; else: endif; //Reset Query wp_reset_query(); } add_shortcode('monthnum', 'mnthly_rndps');
to create a short code to show the posts from a month.
and the short code as exxample
[monthnum id=09]
to show the posts from the month September.
But when I paste that short code in my post then it is showing only 12 post from that month. Canyou tell me the actual problem?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘query_posts function to show the post from a month’ is closed to new replies.