Support » Plugins » Future post on single article of only selected category

  • I,
    want to display the future post but only the single view of a single category.
    I have this function to apply on functions.php

    //funzione per visualizzare post schedulati
    if ( (!is_admin()) ) :
    function __include_future( $query )
    {
    
        if ( $query->is_date() || $query->is_single()  )
            $GLOBALS[ 'wp_post_statuses' ][ 'future' ]->public = true;
    }
    
    add_filter( 'pre_get_posts', '__include_future' );
    endif;

    but I want to apply this only on a single article.
    I have other categories with future post but I want to visualize only the article of my selected category, not all!
    How can I apply this function in my selected single view article?
    Thanks

  • The topic ‘Future post on single article of only selected category’ is closed to new replies.