• Resolved kastali_bleikr

    (@kastali_bleikr)


    So I have been trying to figure out if there is indeed a hook for this. I have found a snippet at this url that describes how to move the slide around your side. Specifically, I am using the Case study : moving the slider below the title in pages that is found on that page. I read through the comments, and made changes to the code to account for the change from TC_ to CZR_ however I can not get the slide to appear between the Page title and the Page Content. I can get it to appear above the Page title or below the page content but not in-between. I’m not sure if there is an action for me to hook unto, or if I have to do something more complex.

    I’ve looked at the Customizr Hooks API Page and did found two actions that looked promising __after_archive_title and __before_archive_title, but neither did anything. In fact the slide just disappeared, which made me believe those are either not supported anymore or are just for archive pages and not just a general page.

    Any help would be appreciated. Like I said, the code below will move the slide around, I just can’t find the particular action to hook the slide between the Page title and Page 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() {
        if ( !is_page() || tc__f('__is_home') )
            return;
        //we unhook the slider
        remove_action( '__after_header' , array( CZR_slider::$instance , 'czr_fn_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( '__need_correct_action' , array( CZR_slider::$instance , 'czr_fn_slider_display' ), 0);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,
    you might want to use this:
    https://presscustomizr.com/customizr/hooks-api/#__before_content_single-page
    with priority 20

    Hope this helps.

    Best regards

    Thread Starter kastali_bleikr

    (@kastali_bleikr)

    Yay! Thank you so much Rocco!!!

    \ o /

    This code worked:

    //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() {
        if ( !is_page() || tc__f('__is_home') )
            return;
        //we unhook the slider
        remove_action( '__after_header' , array( CZR_slider::$instance , 'czr_fn_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( CZR_slider::$instance , 'czr_fn_slider_display' ), 20);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need to know the Action Hook to place a slide between a page title and content’ is closed to new replies.