Single post not displaying by monthnum
-
Namaskaram,
Single post not displaying by monthnum and year . But if i have two post it is displaying fine. Following code i am using.
<?php if (have_posts()) :
//$month = get_query_var(‘monthnum’);
$month = (get_query_var(‘monthnum’)) ? get_query_var(‘monthnum’) : “”;
$year = (get_query_var(‘year’)) ? get_query_var(‘year’) : “”;
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;$args = array(
‘paged’=>$paged,
‘posts_per_page’ => 10,
‘monthnum’=>$month,
‘year’=>$year
);
$countposts=query_posts($args);
//echo ‘the count of posts in ‘ . $month .’/’.$year . ‘ is ‘ . count($countposts);
while (have_posts()) : the_post(); ?>
<div class=”postDate”><big><?php echo get_the_date(‘d’); ?></big> <?php echo get_the_date(‘M Y’); ?></div>
<div class=”postDetail”>
<h4>” title=”<?php the_title(); ?>” rel=”bookmark”>
<?php the_title(); ?>
</h4>
<p class=”author”>By:
<?php the_author(); ?>
</p>
<div class=”post-excerpt”>
<?php the_excerpt(); ?>
</div>Can you tell em the solution.
Pranam.
The topic ‘Single post not displaying by monthnum’ is closed to new replies.