• I want to set time & date for content that I am going to post on my website.

    This content is supposed to be published automatically on the time & date that I have chosen.

    I already know that I can set time & date for when I want the postings on my postings-page to be automatically published.

    But I do not want to post this content on the page that I have set as my postings-page.

    The content will therefore not be a post made on my postings-page.

    Is this possible to do?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Almost anything is possible if you’re willing to custom code a solution ?? Including what you want. The posts that are scheduled for future publishing could be assigned a unique category or tag term. Then alter the postings-page query to exclude posts which have that particular term.

    You can use the “pre_get_posts” action to modify post queries. The trick is distinguishing one query from another. If the query you want to alter is for your home page, you can use WP_Query::is_home() to ensure you’re changing the correct query. Determine what the ID is for the term of whose posts you want to exclude. Set it as the “category__not_in” query var. For example:

    add_action('pre_get_posts', function( $query ) {
      if ( $query->is_home()) {
        $query->set('category__not_in', [ 1234,]); //use correct term ID here
      }
    });

    If your theme is not subject to periodic updates, you can add this to its functions.php. But your code will be removed if a theme updates. To protect your code from updates, you could create a very basic plugin to contain all of your custom code. Creating a plugin isn’t as difficult as it might sound.

Viewing 1 replies (of 1 total)
  • The topic ‘Set time & date for posting content. Not on posting-page.’ is closed to new replies.