• Resolved metteonline

    (@metteonline)


    How do I make the page where my posts are listed private?

    Through my theme settings, I have chosen a static page as my front page and chosen a specific page to show all the posts – y’know bloglike for news and stuff…

    I now want to make the page where the posts are listed visible to only logged in users. Either through WP or a plugin. The thing is when I set the specific page to private it doesn’t affect the content at all. All the posts are still visible to the public.

    As I easily can set my other pages to private I wonder if there is a place somewhere else to set the options for the page containing the posts.

    I can make the posts private, but the idea was to aim it at the page so I don’t have to do it every time a post is published

    If you know what I mean … I’m ready to clarify the issue if I’m not clear enough.

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • When you use a static page as your front page and set another page for your posts, it works a little differently. If you set the posts page to private, it will remove the title from the menu, but the page itself is still visible if you go to the link directly (unlike other pages where it will return a 404). As is, you need to set all your posts to private as well.

    There used to be a Site Visibility setting under Settings->Privacy (pre-WordPress 3.5) and later moved to Settings->Reading, but I’m not seeing it in WordPress 3.6.1…

    Thread Starter metteonline

    (@metteonline)

    Is there no way around this?

    As you can see on my site you can still see the title and the featured image on the page when I make the single posts private. I would prefer if the whole page could be locked which just one message to the visitor. Maybe a plugin or something …(?)

    I’m using the User Specific Content plugin to hide the content from the public.

    I just discovered this recently, but you can’t use a private page for blog posts. If you use a different page for posts and then set that page to private, you can tell from Settings->Reading that WordPress no longer uses that page (I’m guessing it’s using a default like it does when posts are on your front page).

    This is something I need to know, so if you don’t find out from someone else, I’ll be digging into it.

    You might try the plugin route. I’ll be looking at that later today.

    This works for me (but this is just something I threw together, so if it doesn’t do what you want, let me know).

    Add to functions.php of your theme:

    function make_posts_page_private() {
        if ( is_home() && !is_user_logged_in() )
        exit( wp_redirect( home_url( '/' ) ) );
    }
    add_action( 'template_redirect', 'make_posts_page_private' );

    Though you may want to change where the redirect takes the non-logged in user.

    Thread Starter metteonline

    (@metteonline)

    Thank you so much for your help!
    It works perfect ?? Cheers!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Making posts page private?’ is closed to new replies.