Viewing 14 replies - 1 through 14 (of 14 total)
  • See this post

    Thread Starter Justine007

    (@justine007)

    I already found that post, but as a newbie like me I can’t do a anything with that post, moreover he is not giving the code.

    Thread Starter Justine007

    (@justine007)

    bump

    OK, not done this before but can get us started.

    Using this Snippet, I changed the add_action and added an additional one with a different hook (__footer)

    Try this and see if it helps.

    //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() {
    	//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( '__header' , array( TC_slider::$instance , 'tc_slider_display' ), 0);
    	add_action( '__footer' , array( TC_slider::$instance , 'tc_slider_display' ), 0);
    }
    Thread Starter Justine007

    (@justine007)

    Hmm, It copy the same slider. I want different one. ??

    So now try this:

    add_action( 'wp', function() {
        if ( ! method_exists('TC_slider', 'tc_slider_display') ) return;
        add_filter('tc_slider_name_id', function($slider){
            global $wp_current_filter;
            if ( in_array('__before_footer', $wp_current_filter ) ) return 'test';
            return $slider;
        });
        add_action('__before_footer', array( TC_slider::$instance, 'tc_slider_display' ) );
    });

    Change the name ‘test’ to your 2nd slider name.

    Thread Starter Justine007

    (@justine007)

    Parse error: syntax error, unexpected T_FUNCTION in /home/a6862356/public_html/wordpress3/wp-content/themes/customizr-child/functions.php on line 23

    add_action( 'wp', function() {

    php 5.2

    Do you have access to your cPanel, or get your ISP to set you at php 5.4 minimum? php 5.6 is latest.

    Thread Starter Justine007

    (@justine007)

    Slider is not moving…:(

    https://ordinary1.esy.es/wordpress/

    Not sure. That code works in my test site.

    Maybe conflicting with a plugin? Try disabling all plugins and see if it works.

    Thread Starter Justine007

    (@justine007)

    I was using wordpress 4.0.1 and customizr 3.4.8 or older and no plugin or custimization installed.
    Now I am on latest and the slider is moving!

    HOw to make it in custom layout. Is it possible to make a shortcode of the slider or make it in a widget?

    Thanks.

    https://ordinary1.esy.es/wordpress1/

    Thread Starter Justine007

    (@justine007)

    I need three slider side by side in span4 layout.

    To avoid coding, suggest you look at a Plugin (eg Revolution Slider ($) or WPPA (Free)

    Thread Starter Justine007

    (@justine007)

    Hmmm, Thanks. Marking it as resolved. Why dont transfer this code to snippet section.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘More than one slider in a page’ is closed to new replies.