WordPress.org

Forums

WP Hide Post
Plugin not working on posts page (13 posts)

  1. Wonderful Wanderings
    Member
    Posted 1 year ago #

    Hi there,

    I'm using this plugin, but I have to make pages of the posts I don't want to show because the plugin isn't working everywhere for posts...
    I want to be able to hide my posts everywhere, except from searches and search engines, but when I use WP Hide Post, the posts still show up ion my blog page (which isn't my home page) AND when I go through my posts using 'next/previous post'.

    This is pretty annoying as I'm now stuck with a bunch of hidden pages that should actually be posts

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

  2. Wonderful Wanderings
    Member
    Posted 1 year ago #

    Anyone?

  3. IanLeslie
    Member
    Posted 1 year ago #

    I see the same thing. This plug-in was doing just what I wanted until I switched to a static front page. Now the blog page shows the hidden posts even though I don't want them there.

  4. sliceofpie
    Member
    Posted 1 year ago #

    I think I've found a solution, but it involves hacking the plugin.
    You need to replace is_front_page() with is_home() in wp-hide-post.php line 60:

    function wphp_is_front_page() {
    	return is_front_page();
    }

    Should be:

    function wphp_is_front_page() {
    	return is_home();
    }
  5. blaniosh
    Member
    Posted 1 year ago #

    Excellent - I can confirm that the change above works.

  6. LagaV
    Member
    Posted 1 year ago #

    Unfortunately I can't confirm that this code change worked. I still see the hidden post, when opening a listed post.

  7. MaureenBriard
    Member
    Posted 1 year ago #

    Wow, thanks sliceofpie. I was looking for a solution to this problem and your code snippet appears to have done the trick. Great.

  8. RB001
    Member
    Posted 1 year ago #

    Thanks sliceofpie that worked for me

  9. Shaan
    Member
    Posted 1 year ago #

    Yes, I can confirm that the code works for me as well.

  10. neocast
    Member
    Posted 10 months ago #

    Code snippet worked for me as well.

  11. dubpluris
    Member
    Posted 7 months ago #

    Worked for me too. Seems like this should be included in the plugin as its pretty common for the blog not to be the homepage. Thanks!!

  12. terri_c
    Member
    Posted 7 months ago #

    This hack worked for me for a little while, but now my hidden posts are showing again. I still have the correct code in the php file. function wphp_is_front_page() {
    return is_home();
    }
    Any thoughts?

  13. theZedt
    Member
    Posted 5 months ago #

    is_front_page() and is_home() return different results depending on who is displaying your posts list (the "homepage" or the "blog page").

    That's why one works for some while the other for others.
    Changing to

    return is_home() || is_front_page()

    will match both cases (but may match too much).

    See http://codex.wordpress.org/Function_Reference/is_home for reference.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Hide Post
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic