• 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 https://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 ?

Viewing 1 replies (of 1 total)
  • Thread Starter erwanpia

    (@erwanpia)

    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' );
Viewing 1 replies (of 1 total)
  • The topic ‘date template and future posts’ is closed to new replies.