• Hello!

    I would like to know if there would be a possibility to hide the “password protected” posts from the main index page and having a possibility to have them (and only them) on a special page. The reason is to offer some people the possibility to access new stuff before anyone else. No need for login or private thing. People would access that special page (no need to hide it either) and enter the password for the posts and that’s it.

    But I don’t want to see all this “exclusive” stuff on the main page. Having 20 password protected posts before having a standard post is not a good idea or attractive for standard users.

    So, on the main page: every posts, except the password protected.
    Then, on a special page, only the password protected posts.

    Any simple way to do this? I’m not a coder, but I can manage with a good explanation.

    Thanks in advance!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi Awareman,
    U have display private post listing using this plugin.
    Advanced Post List

    Using a post status u have get posts.
    Now in your case use with private status post.

    More details

    Thanks,
    Ravi patel

    Thread Starter Awareman

    (@awareman)

    Hello! Thank you. I will have a look at this!

    Thread Starter Awareman

    (@awareman)

    Hi again. I’ve installed the plugin, but I’m a little lost there on what to do next… o.O

    Thread Starter Awareman

    (@awareman)

    Sorry, I’ve been looking around on how to use or to make this thing to work, but I can’t even seem to understand a single piece of this plug-in, or its actual purpose…

    Any other suggestion?

    Thread Starter Awareman

    (@awareman)

    I found this piece of code that some sort works partially (to put in the index.php of the theme folder):

    <?php
        if ( post_password_required() ) {
                continue;
        } else {
               echo 'normal post';
        }
    ?>

    It hides the password protected posts, but then it hides it everywhere. And I want either a special page where to see them, either having it into a category. But with that code, it vanishes everywhere…

    Thread Starter Awareman

    (@awareman)

    What I did so far:

    The code below has been put on the index.php:

    <?php
        if ( post_password_required() ) {
                continue;
        } else {
               echo '';
        }
    ?>

    However, the problem with that is when there are for exemple more than 10 password protected posts, the first page is empty, wich is bad. So, that is not a good solution. Works only when there are once in a while password protected posts.

    Secondly, I made a new page template by cloning the index.php and put the template things on the top:

    <?php /* Template Name: Private (TEST) */ ?>
    <?php get_header(); ?>
    etc...

    I then tried many things and tests, some got results, some big bugs, others worked halfly but with bugs too or missing stuff…

    <!-- test 1 -->
    <?php query_posts('cat=130'.get_the_title().'&post_status=publish,future'); if (have_posts()) : while (have_posts()) : the_post(); ?>
    <!-- end test 1 -->
    
    <!-- test 2 -->
    <?php query_posts('category_name=prive'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <!-- end test 2 -->

    Any suggestion, help? I’m not a coder and have no real notion of PHP, only HTML. I took these lines of code here and there with google search…

    Thread Starter Awareman

    (@awareman)

    So… nobody here? :-/

    Thread Starter Awareman

    (@awareman)

    I guess, I’ll have to find help somewhere else!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Password protected posts on a special page only’ is closed to new replies.