Forums

Displaying Current MONTH's Posts on Frontpage (4 posts)

  1. EricEnder
    Member
    Posted 4 years ago #

    Can anyone show me a way of displaying all the posts I have in the current month (ie, January 08) and specifically from a specific category on the frontpage?

  2. Otto
    Tech Ninja
    Posted 4 years ago #

    Before the Loop in your main index.php file, add something like this:

    if (is_home()) {
    query_posts($query_string . '&cat=123&monthnum=' . date('n',current_time('timestamp')));
    }
  3. hilife
    Member
    Posted 4 years ago #

    this is what is in my index file

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    ?>

    so add the above code in there like so :

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');

    if (is_home()) {
    query_posts($query_string . '&cat=123&monthnum=' . date('n',current_time('timestamp')));
    }
    ?>

  4. moshu
    Member
    Posted 4 years ago #

    No. You never ever edit the short and sweet index file.
    Mess around with the index file of your theme.

Topic Closed

This topic has been closed to new replies.

About this Topic