All posts for Month in Sidebar (4 posts)

  1. webrob
    Posted 9 years ago #

    I am wondering if there is a way to display all of the posts for a specific month under it's respective month in the sidebar. My customer says that Blogger does this and he would like this functionality.

  2. sanchit
    Posted 9 years ago #

    I had actually modified the calendar thing in the sidebar to achieve this functionality.

    This is what I did to the general-template.php file. Just search for thead and you'll get there.

    	<tr><td align="center" colspan="7"><a href="' .get_month_link($thisyear, $thismonth) . '"> ' . $wp_locale->get_month($thismonth) . ' ' . date('Y', $unixmonth) . ' </a></td></tr>
  3. webrob
    Posted 9 years ago #

    I am not sure about the calendar...do I have to ahve that installed?

  4. sanchit
    Posted 9 years ago #

    <?php echo '<a href="' .get_month_link($thisyear, $thismonth) . '"> ' . $wp_locale->get_month($thismonth) . ' ' . "This Month" . ' </a>' ?>

    This line will give you the current month's archive page. You aldready have that calendar installed. Its called in the sidebar if you put in these lines:

    <h2><?php _e('Calendar'); ?></h2>
    <?php get_calendar(); ?>

    I modified the wp-includes/general-template.php because the calendar already had the functionality to switch months so all I had to do was change the code a bit to make the month a link.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.