WordPress.org

Ready to get started?Download WordPress

Forums

Future post on single article of only selected category (1 post)

  1. pettedemon
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic