Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #978049
    trojans101
    Participant

    How can I hide a blog post from displaying in the blog?

    I’m looking to hide specific blogs to showing up in my blog.

    Any ideas?

    Thanks so much 🙂

    #978116
    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in!

    You can use WP Hide Post plugin to hide specific blog posts showing up in blog page:

    https://wordpress.org/plugins/wp-hide-post/

    Thanks.

    #1005611
    trojans101
    Participant

    Hi there,

    This plugin doesn’t seem to hide posts from the blog. Any other plugin?

    #1005657
    Thai
    Moderator

    Hi There,

    Please add the following code under functions.php file locates in your child theme:

    function x_exclude_single_posts_home($query) {
      if ($query->is_home() && $query->is_main_query()) {
        $query->set('post__not_in', array(123,456,789));
      }
    }
    add_action('pre_get_posts', 'x_exclude_single_posts_home');

    Replace 123, 456, 789 with your post IDs.

    Hope it helps 🙂

  • <script> jQuery(function($){ $("#no-reply-978049 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>