WordPress.org

Ready to get started?Download WordPress

Forums

Private Blog (5 posts)

  1. kwdavids
    Member
    Posted 8 years ago #

    What's the best way to set up a private blog, one just a few people can read?

    The best I've been able to come up with is password-protecting the WordPress directory, but that's somewhat awkward.

    Thanks,
    Kevin

  2. technogenii
    Member
    Posted 8 years ago #

    I'd actually like something similar. Like a public section of my site and a private section where only logged in users could see certain parts. In fact, what would be ideal is if there could be a "private" category so that when something is linked to that category, it requires a password.

    Thanks
    Kristina

  3. Kafkaesqui

    Posted 8 years ago #

    kwdavids, an example index.php (for the root of your blog, not the index.php with your theme) to get you going:

    <?php
    $siteurl = 'http://my-blog-site';

    $cookiehash = md5($siteurl);
    if(empty($_COOKIE['wordpressuser_' . $cookiehash])) :
    header('Location: '/wp-login.php');
    else :
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    endif;
    ?>

    Provide the same address for $siteurl as the one for the WordPress address (URI) setting in Options > General. It has to match exactly. And in the header() argument make sure 'Location' is correct for the path to wp-login.php. Alternatively you can point to any document (of your own devising), or display a modified login, or whatever you feel is appropriate.

    Kristina, a couple plugin options you could take a look at:

    http://blog.firetree.net/2005/08/25/viewlevel-20/
    http://gregelin.com/archives/index.php/3

  4. technogenii
    Member
    Posted 8 years ago #

    Kafkaesqui! Thanks so much. I added both plug-ins and they are doing exactly what it is that I wanted them to do :-)

    Kristina

  5. nemloc
    Member
    Posted 7 years ago #

    That second link on gregelin.com isn't valid anymore, what's the best way of making most of the blog posts private while still leaving a few public ones given wordpress 2.0.4?
    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags