WordPress.org

Ready to get started?Download WordPress

Forums

date template and future posts (2 posts)

  1. erwanpia
    Member
    Posted 3 years ago #

    Hi, I am trying to use the date tempalte with the get_month_linkto display fuiture post of a specific month (in the future)

    what hook should I catch in order not to get a 404 when the url date is in the future

    eg http://www.barzhoneg.com/2011/03 even though I would like to display specific posts from the event category in that future month . Understand my problem ?

  2. erwanpia
    Member
    Posted 3 years ago #

    OK found the parse_query action, which does the job !!

    function fb_filter_query ( $query, $error = true ) {
    
         if( is_date())
            $query->query_vars['post_status']="publish,future";
       //  print_r($query);
    
    }
    
    add_action( 'parse_query', 'fb_filter_query' );

Topic Closed

This topic has been closed to new replies.

About this Topic