[Support request] how to hide blog post?

Home Forums Support [Support request] how to hide blog post?

Home Forums Support how to hide blog post?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2365786
    jisu

    Hi,
    Is it possible to hide blog post but still have valid urls? I want to use the post in our ios app.

    Also, i have set the blog post padding but can i set or delete in specific blog post?

    here is the link
    https://swim.im/mobile-app-test/2382/

    #2365811
    Fernando
    Customer Support

    Hi Jisu,

    I’m not getting the full grasp of what you’re trying to do. May you expound a bit more and provide an example of what you’re trying to do?

    #2365846
    jisu

    How can i exclude my post from blog page? https://www.swim.im/blog

    i just need a url of a post but now show on my blog page.

    and also how can i exclude channel.io plugin in certain page?

    #2365851
    Fernando
    Customer Support

    I see. Are you planning to exclude all posts or just specific posts? If it’s all posts, what should you Blog page look like.

    With regards to Channel.io, how are you adding that currently?

    #2365863
    jisu

    specific post.

    #2365876
    Fernando
    Customer Support

    I see.

    Try adding this code:

    function excludePostId($query) {
      $postIds = array(
        66
      );
    
      if ( $query->is_home() && $query->is_main_query() ) {
        set_query_var('post__not_in', $postIds);
      }
    }
    add_action('pre_get_posts', 'excludePostId');

    Replace 66 with the ID of the post.

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

    If you want to hide it in archive pages and search pages as well, we’ll need to modify that code. Let us know.

    #2366004
    jisu

    Thank you for the reply. is it possible to hide whole category?

    #2366007
    jisu

    and where do i add this code?

    #2366086
    David
    Staff
    Customer Support
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.