Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #1407083

    I have a custom post type called “locations”.
    I am using a WordPress template called single-locations.php in a child theme for these individual custom posts.
    There are thousands of posts in this custom post type, and none of the content on these posts have the [LayerSlider] shortcode in them and I am using the single-locations.php file to modify the post content to add it based on some simple conditions.
    So far I can generate the the correct layerslider shortcode text and insert it into the custom post’s content, but the shortcode is printed out and not parsed.

    I have determined that it has to do with the LayerSlider not being initialized when it scans the custom post’s content, before I am able to modify the content at the time single-location.php is loaded in the processing tree.
    Is there a way to trigger the loading/initialization of the LayerSlider parsing so that it can handle the [layerslider id=”##”] tag at the time I modify it and output the contents to the browser?


    I have referred to a variation of this patch to get the layerslider parsed and display in my content, but every time that I install a new version of the theme, this patch will get overwritten.
    It would be nice to be able to have a solution that works in my child theme.


    Thanks for your question but this patch is already in the current enfold\config-layerslider\config.php on line 743
    If you mean that you have customized the patch to work for your situation then you can try adding the modified ‘config-layerslider’ directory to your child theme, but I don’t think this will work because the parent theme functions.php calls the ‘config-layerslider/config.php’ directly on line 106.

    Best regards,


    Yes I do mean that I have modified the patch even further beyond what is currently now available as the patch in question.
    I don’t like the way that enfold chooses whether or not the layer slider is available in the logic, and furthermore I don’t like how we can’t change that with a child theme.

    It would be pertinent to be able to make this modification at the child theme level.


    I’m not sure so I have asked the rest of the team for advice, thank you for your patience.

    Best regards,


    The Dev Team replied to try adding a copy of our file (\config-layerslider\config.php) in child theme and remove these lines from the bottom:

    function Avia_Config_LayerSlider( $class_name = '' )
    	return Avia_Config_LayerSlider::instance( $class_name );
     * Initialise class and hooks

    Make the modifications you want to make in the child theme file, at end of functions.php of child theme include this file.
    When the original file is loaded by the theme functions.php it recongnizes that the class already exists and only executes the lines at the bottom,

    Best regards,


    I was able to make these changes and it works as expected!
    Thank you!



    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.