Can hide a post in the single post page, but not in the blog home page

I want to completely hide a post from strangers (visitors). I've read about using the "more" tag as a teaser, and I like the sounds of that, but for now I just want to hide posts completely.

I was able to hide posts in single post pages, but I wasn't able to hide them in the blog home page (see screenshots).

How do I hide them from the blog home page, too?

  • aristath
    • Recruit

    Hello there @Matt, I hope you're well today!

    Could you please grant us access to your backend so that we may see exactly what is happening?
    To do so, from your dashboard go to WPMUDEV => Support => Support Access and click on the "Grant access" button.

    Also your screenshots did not get attached on your previous poist, could you please try re-uploading them?

    Please advise,
    Ari.

  • Matt
    • WPMU DEV Initiate

    Does anyone have any suggestions?

    I've been playing with the plugin levers, but the only one I can find that affects the blog homepage is the "more" lever.

    How else can I affect what shows up on the blog homepage?

  • Matt
    • WPMU DEV Initiate

    I found my answer, or at least the start of it, on another forum and outside of the plugin.

    However if the plugin has this kind of functionality, I'd love to know how to do it within the plugin, rather than taking the "duct tape and bailing wire" approach to solving problems.

  • Michael Bissett
    • Recruit

    Hey @Matt, sorry for the delay here!

    You can hide posts from the front end by adding "Posts" from the Main Rules section as a negative rule. Then you can select the posts you wish to hide (see screenshot below).

    Hope that helps, let me know if more assistance is needed. :slight_smile:

    Regards,
    Michael

  • Matt
    • WPMU DEV Initiate

    After I spent about 6 hours trying to get the plugin to hide negatively-selected posts from the blog home page, I added this to the custom.php file (I use Thesis -- other themes will have their own preferred locations for php edits):

    /* EXCLUDE CATEGORY */
    function exclude_category($query) {
    if ( $query->is_home ) {
    $query->set('cat', '-68,-69,-70');
    }
    return $query;
    }
    add_filter('pre_get_posts', 'exclude_category');
    /* EXCLUDE CATEGORY */

    ...where 68, 69, and 70 are the category ID's I was trying to hide from the blog homepage.

    That code hides the posts (on the blog homepage, at least) from everyone, including the paid members, but I can work with that -- having plugin-"protected" blog posts show up in their entirety on the blog homepage was a bigger problem.

    It would have been nice to solve the problem with the WPMU Dev plugin, and that would still be my preferred method, but it wasn't working with the plugin, which is why I posted for help on this forum.

  • Matt
    • WPMU DEV Initiate

    Dear Jack,

    Thanks for the info. I'm glad to hear I wasn't unsuccessfully looking for something, it just wasn't there. :wink:

    By the way, I would highly recommend a feature like this for future releases. I might have solved my problem by going outside the plugin, but I suspect there are other customers who, wanting to restrict access to certain blog posts, would not want those blog posts showing up on the home page. It seems like a no-brainer feature. But you know best, you're the ones who sell the plugin.

    Matt

    Matt

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.