Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #1107943

    As of LayerSlider documentation, that you can find here,
    it should be possible to hook to some actions to add custom html. In particular layerslider_before_slider_content and layerslider_after_slider_content, but it’s not working.

    Echoing my custom div using the action layerslider_after_slider_content the div appears before the slider and not after.
    So I checked in your file enfold/config-layerslider/LayerSlider/includes/slider_markup_html.php and I discovered that the whole slider output is put into an array varaible ($lsMarkup) and it’s printed later, in another file. That’s why it goes before the actual slider.

    So, to make it work, instead of echoing my div in my function, I appended it to the array varialble, that obviously it’s not available in my function, meaning that I had to edit your file and add global $lsMarkup; around the top of slider_markup_html.php file.

    Now it’s working fine, but do you think it’s useful to fix this thing in my way to allow those actions to work properly?




    Hey f.giorgini,
    Sorry for the late reply, glad to hear you were able to create a solution, but can you link to a copy of your layerslider_after_slider_content function so we can try to recreate the issue?

    Best regards,


    Hi Mike and thanks for your reply.
    You can actually try it by printing whatever comes in your mind and then check via Chrome Dev Tools, where the new div was inserted.
    This is an example:

    add_action( 'layerslider_after_slider_content', 'add_div_after_slider' );
    function add_div_after_slider() {
    	echo '<div id="my-new-div">Blah blah</div>';

    You will see that it’s added before and not after the slider code, for the reason I explained in my previous post.


    Sorry for the late reply, and thanks for the example code. I was able to reproduce so I wrote a report for the dev team to review your solution.
    Thanks for sharing.
    I will post here as I learn more.

    Best regards,



    The file enfold\config-layerslider\LayerSlider\includes\slider_markup_html.php containing this hook is part of layerslider plugin – there is not much we can do.

    I will ask if we can forward this to layerslider devs. Maybe you can also try to place a report about that there?

    Best regards,


    I am having trouble trying to remove a video that is linked to my header. Can you please explain where I can get in to remove it? I don’t know if an update has prevented me from getting to it.


    Hi Racergirlmel,

    I’ve replied to your other thread already, let’s continue in there.

    Best regards,

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

You must be logged in to reply to this topic.