WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
Blocking template pages or pages displaying posts (5 posts)

  1. steckinsights
    Member
    Posted 2 years ago #

    First off, Chad Butler has been excellent at answering questions regarding this plugin. I wish him much success!

    In effort to create a page that displays posts from a particular category, I followed WordPress' instructions and created a template file that will pull it's content from posts marked with the category I specify in custom fields. This all worked successfully.

    I'm having a difficulty using the instructions given regarding blocking pages. I've read the forums and I know there was a mistaken typo regarding block/unblock, true/false, etc. It's not that.

    I think the problem has to do with the template. WordPress advises that you create a template file (which they give an example of in the link above), upload it, call that file via the page attributes menu in "Edit Page", then specify which category to call using a custom tag.

    Therefore, my page does not have any of it's own content, but instead pulls content from posts. I think that this is allowing the template to supersede the WP-members plugin and disable the blocking feature. For example, I have all pages blocked by default, but the page I created that uses the custom template is not blocked. All the posts are shown. I am unable to block them at the article/page level.

    Any questions, comments, suggestions or solutions are welcome!

  2. Chad Butler
    Member
    Plugin Author

    Posted 2 years ago #

    THAT is an interesting dilemma and I don't have an answer for you right off the bat. I am going to have to give this a go on my system to see what I come up with.

    Off the top of my head, you might try wrapping this with

    if( is_user_logged_in() ) {
    
    ...user is logged in, do something here...
    
    } else {
    
    ...user is not logged in, not sure what to do here, but possibly call some wp-members function...
    
    }

    That's certainly not a full answer, but it might give you some ideas. I'll need a couple of days before I can really look at this.

    Thanks for the kind words, btw... ;-)

  3. steckinsights
    Member
    Posted 2 years ago #

    We went with another solution, but will try this in the future. Thanks again @ChadButler.

  4. spectrus
    Member
    Posted 2 years ago #

    Do you mind posting your solution? Or did you mean that you've switched to another plugin?

  5. Chad Butler
    Member
    Plugin Author

    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags