• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Hiding content in a custom Membership Genesis site

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Hiding content in a custom Membership Genesis site

This topic is: not resolved

Tagged: gatekeeping, membership

  • This topic has 3 replies, 2 voices, and was last updated 10 years, 7 months ago by jdcohan.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 15, 2014 at 4:44 pm #127929
    jdcohan
    Member

    I need to find a way to hide content from visitors who have not signed into a custom-built sign-in area. (Note that I am _not_ using the WordPress login system for this gatekeeping.)

    I'm working on a Genesis (genesis-sample child theme) site that utilizes custom members-only gatekeeping via custom functions in the mu-plugins directory. The gatekeeping is based on the presence and values of PHP session variables that are set when a member signs in via the custom sign-in form I've created.

    (BTW, I opted for a custom-built membership system after seriously considering s2Member and determining - in collaboration with s2Member's creators - that it would not meet the requirements.)

    For all those site pages that are based on custom templates I've created, it's easy: a visitor who has not signed into the custom membership system will see a warning message (e.g., "Sorry, you don't have sufficient privileges to view this content"). There's some relatively simple conditional PHP code that checks session variables. (Essentially, the code checks to see if the session variable for "logged_in" is (a) set and (b) true.)

    My question: How to implement this gatekeeping on pages that are based on standard Genesis page templates.

    If this were a site built on twentytwelve, for example, I'd just insert my conditional scripting in a copy of "content-page.php" file and store it in my child theme directory. But with Genesis, I'm having trouble understanding where and how to do what I need to do.

    Please be assured that I'm posting this only AFTER having spent considerable time researching Genesis building blocks (actions and filters; Genesis Simple Hooks; etc.) via StudioPress resources such as Code Snippets, Tutorials, Community Resources, and, yes, the Beginners Guide.

    I'm sure I'll need to provide more info if anyone is game and kind enough to help me down this path. Thanks in advance.

    Jeff Cohan

    October 16, 2014 at 12:42 am #127963
    Brad Dalton
    Participant

    Have you tried using conditional tags and hooks?

    What code are you using?


    Tutorials for StudioPress Themes.

    October 21, 2014 at 9:48 am #128653
    jdcohan
    Member

    Brad -
    a) Which tags and hooks to use was my quandary.
    b) Simple conditional php code testing the presence and values of auth-related session variables.

    Update: I have things working now via a simple custom page template for protected pages whereby the conditional php code shows the protected content to signed-in members and an error message to any others.

    October 21, 2014 at 2:47 pm #128684
    jdcohan
    Member

    New, related challenge:

    All blog posts (and blog archive pages) on this site need to be protected. If a certain session variable is set and true, a visitor will see the content. Otherwise the visitor would see a "Not-authorized" message.

    I've got the session variable stuff taken care of, and I've got this working for single blog posts and static pages.

    My question: How would you folks do this for archives?

    TIA,
    Jeff

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble