This topic has 2 replies, 2 voices, and was last updated 10 years by ACTasarim.

  • Author
  • #10060
     ACTasarim
    Participant

    Hello

    I’ve removed the Search Form for logged in users with success by using this code snippet in my child-functions.php:

    add_action(‘after_setup_theme’,’remove_search_form’,11);
    function remove_search_form() {
    remove_action(‘after_header_content’,’render_user_search’);
    }

    Now I also want to remove the Revolution Slider for logged in users. Only Visitors (Non Logged in users) should see the Rev Slider.

    How can I do that?

    Thanks

    #10107
     Andrei
    Moderator

    Hello,

    You could use the following code snipped to achieve that:

    COPY CODE
    
    add_action('after_setup_theme', 'remove_revslider', 100);
    function remove_revslider() {
    	if(is_user_logged_in()) {
    		remove_action('kleo_after_header', 'kleo_page_revslider');  // for pages
    		remove_action('kleo_after_header', 'kleo_home_revslider'); // for home page
    	}
    }
    

    Let me know if this resolves your problem.
    Waiting feedback !

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #10116
     ACTasarim
    Participant

    It worked Andrew 🙂 I had to change all the ’ with ‘ . So for future references the working version of Andrew’s code is:


    add_action('after_setup_theme','remove_revslider',100);
    function remove_revslider()
    {
    if(is_user_logged_in()) {
    remove_action('kleo_after_header', 'kleo_page_revslider'); // for pages
    remove_action('kleo_after_header', 'kleo_home_revslider'); // for home page
    }
    }

    Thank you

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Remove Rev Slider for logged in users’ is closed to new replies.

Log in with your credentials

Forgot your details?