• Resolved rocketmena

    (@rocketmena)


    Am using smart slider in our website. We created slider and signup button also in the slider banner. How i can hide this signup button that i created with smart slider if a user already logged in

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ramona

    (@nextend_ramona)

    Hi @rocketmena

    Unfortunately, we don’t have option to manipulate the slider for logged in or not logged in users.

    The simplest way (although that involves custom coding, too) I can think of is adding a custom CSS class to the layer at layer window > Settings tab: https://smartslider3.helpscoutdocs.com/article/392-layer-window-settings
    With a bit of PHP coding, you can determine if the user is logged in or not: https://developer.www.ads-software.com/reference/functions/is_user_logged_in/
    and you can display a short CSS code to hide this button. You’ll need to put this code to your theme’s file. I suggest the header.php, just below the wp_head().

    For instance, if you use the “hide-for-logged-in” class to add at the layer window > Settings, you can use a PHP snippet like this:

    <?php 
        if(is_user_logged_in()){
            echo "<style>.hide-for-logged-in{display:none;}</style>";
        }
    ?>

    The best way to make changes like this to a theme is to use a child theme, so your tweaks won’t be overwritten when updating the theme.

    Thread Starter rocketmena

    (@rocketmena)

    Hello,

    Thank you so much for your help. This is working fine for me. Thanks a lot

    • This reply was modified 5 years, 4 months ago by rocketmena.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Smart slider button hide’ is closed to new replies.