Okay
  Public Ticket #3769166
Display Future Posts in Post Loop Builder
Open

Comments

  •  8
    Max started the conversation

    Hello,

    I am using the Salient theme on my WordPress site and I am trying to display future (scheduled) posts within the Post Loop Builder. I have successfully managed to display future posts on category pages, but they do not appear in the Post Loop Builder.

    I have already tried several methods, including modifying the query in the functions.php file to include both published and future posts, but the issue persists. The future posts still do not show up in the Post Loop Builder section.

    Could you provide guidance on how I can ensure that scheduled posts are included in the Post Loop Builder display, or if there are any specific settings or customizations in Salient that need to be adjusted for this to work?

    I would appreciate any help or direction you can provide.

    Thank you!

  •  8,860
    Tahir replied

    Hey Again,

    Could you confirm the Category of the Future Posts are selected in the Post Loop Builder Settings ?.

    If not then the post wont show. 

    Best,

     


    ThemeNectar Support Team 

  •  8
    Max replied

    Thanks for your reply.

    I don't find that.
    I just added this code on function.php :

    <?php 
    function salient_include_future_posts_in_loop($query) {
        // Vérifie que la requête est celle du Post Loop Builder
        if (is_main_query() && !is_admin() && isset($query->query['nectar_blog_style'])) {
            // Inclut les articles planifiés (futurs) dans les articles récupérés
            $query->set('post_status', array('publish', 'future'));
        }
    }
    add_action('pre_get_posts', 'salient_include_future_posts_in_loop');

    ?>

  •  8,860
    Tahir replied

    And did this resolve your issue ?. I am referring to the Category selection in here. See screenshot: 9382790986.png 

    Best 


    ThemeNectar Support Team 

  •  8
    Max replied

    I put ALL...

  •  8
    Max replied

    Unfortunately it still doesn't work.