Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

Using the "If Member is logged in" script

Simple Membership Plugin › Forums › Simple Membership Plugin › Using the "If Member is logged in" script

Tagged: php, user login

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 9 months ago by mbrsolution.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 20, 2015 at 3:25 pm #2382
    twoarmtom
    Participant

    I tried using the following script on my site, but it shows even when no member (including myself) is logged in. Do I have to add it to a particular part in my page? I’m using it in an html block in Visual Composer.

    <?php if(SwpmMemberUtils::is_member_logged_in()) { ?>
    //Your message for logged-in members goes here
    <?php } ?>

    Any help would be appreciated, Thanks!

    July 20, 2015 at 11:10 pm #2387
    mbrsolution
    Moderator

    Hi, you need to add the function to a page template. When you create a page in your website you will select a template for that page. This is the template that you add the above function to.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy