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

How to hide the Portfolio FILTER mechanism?

Simple Membership Plugin › Forums › Simple Membership Plugin › How to hide the Portfolio FILTER mechanism?

Tagged: shortcode members

  • This topic has 3 replies, 2 voices, and was last updated 9 years, 4 months ago by TroyWolf.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 8, 2016 at 10:59 am #8168
    smdeekster
    Participant

    I’m using AVADA theme, and it’s Portfolio custom content type.
    https://theme-fusion.com/avada-doc/portfolio/portfolio-filters/

    I wonder does anyone know how to hide (Protect) the actual Filter list itself ?

    I know how to protect the subsequent Portfolio pages (via Category Protection) but the filterable list itself remains visible to non-authenticated users and I do not want them to see this.

    Any ideas? Thanks.

    September 8, 2016 at 1:39 pm #8172
    TroyWolf
    Participant

    My guess is that you will have to get your hands a little “dirty” with a PHP code tweak. The hardest part can be simply figuring out which PHP file is responsible for outputting that AVADA filter component/widget. Once you do, you can wrap it with a bit of code like this:

    <?php if(SwpmMemberUtils::is_member_logged_in()) { ?>
        //AVADA filter output code here...
    <?php } ?>

    Here are some good snippets–which is where I stole the example above:
    https://simple-membership-plugin.com/simple-membership-miscellaneous-php-tweaks/

    September 8, 2016 at 1:46 pm #8173
    TroyWolf
    Participant

    This reminds me of a thought I’ve had that might be useful. How about a Simple Membership “Protect Content Widget” that could be used in the Widgets section. It would be very simple and would have basically 2 options.

    1. Require Login / Require NOT logged in
    2. The content to protect.

    The content to protect could be any bit of HTML or short code, etc. So for example, if you have a plugin that offers a short code to show some bit of content and you only want members to see that content, you would use the SWM Protect Content widget then put your short code into it.

    Any reason this idea would not work? (I’m not a widget or WordPress expert.)

    January 24, 2017 at 3:27 pm #9848
    TroyWolf
    Participant

    I wanted to follow up here to help others with this same need. If you want an easy way to have blocks of content that show or hide based on “MEMBER” or “NON MEMBER”, you can add these handy shortcodes. This requires you to edit a PHP file.

    Edit this file /wp-content/themes/<your theme>/functions.php

    Add this to the file–the bottom of the file works fine:

    add_shortcode('MEMBER','show_member_content');
    function show_member_content($atts,$content = null){
        global $post;
        if (SwpmMemberUtils::is_member_logged_in()){
            return do_shortcode($content);
        }
        return '';
    }
    
    add_shortcode('NON_MEMBER','show_non_member_content');
    function show_non_member_content($atts,$content){
        if (!SwpmMemberUtils::is_member_logged_in()){
            return do_shortcode($content);
        }
        return '';
    }

    Using these shortcodes, you could, for example, have a block of text on any page that does something like this:

    [NON_MEMBER]JOIN TODAY![/NON_MEMBER]
    [MEMBER]Thanks for being part of our community![/MEMBER]

    The appropriate text will display depending on whether the member is logged in or not. I used this for example to have a blurb on my home page to encourage people to join. If they are already logged in, I replace that with a bit of text thanking them for being a member. I also use these shortcodes on my “Become a Member” page. If a member goes to this page, the page tells them they are already a member and gives an overview of membership benefits. Otherwise, they see the JOIN button, etc.

    I would suggest that these shortcodes should be part of the Simple Membership plugin by default.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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