WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
Not able to restrict pages (10 posts)

  1. smashingpixels
    Member
    Posted 8 months ago #

    Hi,

    I've installed the wp-members plugin, block pages by default is unchecked and on my single page i selected the option 'Block this page'.

    Show excerpts is also unchecked. But still the entire page content is being shown even when I'm logged out.

    The page I am trying to blog uses the default page template. Is there something that I have to add here to make it work?

    I am currently developing the wordpress theme by myself and using this plugin. I do not know what i'm missing.

    Please help.

    Thanks!

    Regards,

    Jogi Nayak

    http://wordpress.org/plugins/wp-members/

  2. Chad Butler
    Member
    Plugin Author

    Posted 8 months ago #

    Are you using any of the wp-members shortcodes in the page you are trying to block?

  3. smashingpixels
    Member
    Posted 8 months ago #

    No I'm not.

  4. smashingpixels
    Member
    Posted 8 months ago #

    Hi Chad,

    Any idea yet what could be going wrong here? Is there any other details you want me to give you ?

    Thanks.

  5. Chad Butler
    Member
    Plugin Author

    Posted 8 months ago #

    The plugin by default only handles page and post post types. If you are using a custom post type, there are customizations for allowing those to be blocked, but the plugin won't do it by default.

    You said you are developing this theme yourself. Does the theme make proper use of the Loop? The plugin only handles content that is in the $content variable within the Loop.

    If it is a page (not a post) and you have the plugin set to display content excerpts in the plugin options, you MUST use the 'more' tag. If you don't, the entire page content is going to be the excerpt.

  6. smashingpixels
    Member
    Posted 8 months ago #

    Hi Chad,

    Thanks for the reply. I am not using a custom page type.
    This is the content of my page.php and all pages use this.

    <?php
    /*
    Template Name: Single Page
    */
    ?>
    <?php get_header() ?>
    <div id="main">
    <div id="general" class="m2 right">
    <h2 class="dotted"><?php the_title(); ?></h2>

    <div class="t2 user-edit">

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>

    </div>
    </div>
    </div>
    <?php get_footer() ?>

    Do you think I'm missing something here ?
    Thanks.

  7. Chad Butler
    Member
    Plugin Author

    Posted 8 months ago #

    That looks valid. So I would take a look at the last element I mentioned above:

    If it is a page (not a post) and you have the plugin set to display content excerpts in the plugin options, you MUST use the 'more' tag. If you don't, the entire page content is going to be the excerpt.

  8. smashingpixels
    Member
    Posted 8 months ago #

    Yes, I have tried that but it doesn't seem to work. I have unchecked " Shows excerpted content above the login/registration on both Posts and Pages" . I also checked it and added the more tag but still in vain. Please let me know if you can think of anywhere else I could have gone wrong. Thanks.

  9. smashingpixels
    Member
    Posted 8 months ago #

    Hey chad,

    Can you tell me the php code to check if the user is logged in ? May be I can add this myself to the page and restrict it. I guess this would solve all my problems since everything else seems to be working alright !

    Thanks.

  10. respectyoda
    Member
    Posted 8 months ago #

    Here's the code to check if the user is logged in.


    <?php if ( is_user_logged_in() ) { ?>
    //add whatever you want here
    <?php } ?>

Reply

You must log in to post.

About this Plugin

About this Topic