• Resolved lozadaOmr

    (@lozadaomr)


    Is it possible to put the Customizr slider in between the two Sidebars (using a Left & Right sidebar pagelayout)?

Viewing 2 replies - 16 through 17 (of 17 total)
  • Sorry, I will.
    In any case, your answer is not for my case, because I need the slider after the title.

    Regards.

    Hello marcuse_alfa!

    This is my solution to position the Slider immediately below the title of the Page/Post and immediately before the Content.

    //we hook the code on the wp_head hook, this way it will be executed before any html rendering.
    add_action ( 'wp_head' , 'move_my_slider');
    
    function move_my_slider() {
    /* Applico solo se si tratta di una pagina e non è la HomePage */
    	if(!is_home() && is_page()) {
    		//we unhook the slider
    		remove_action( '__after_header' , array( TC_slider::$instance , 'tc_slider_display' ));
    
    		//we re-hook the slider. Check the priority here : set to 0 to be the first in the list of different actions hooked to this hook
    		add_action( '__before_content' , array( TC_slider::$instance , 'tc_slider_display' ), 10);
    		}
    }

    The trick is to play with the priorities of the action that you are entering in the chain of events “__before_content”.
    It is sufficient to use a lower priority to 0, in my case I used 10, and your action is executed at the appropriate time.

    Note: In this case I wanted the slider was always after the title of the pages or posts.
    On the home page, however, I want to keep the slider in the standard position!

    Try it and you’ll see that it works!

    Bye-bye!

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Customizr Slider with Sidebar’ is closed to new replies.