Tagged: bug
-
AuthorPosts
-
August 24, 2018 at 8:41 pm #1001394
Hi,
I use this snippet from here in latest ENFOLD version
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
so far, works fine.
But:
when you use the regular ALB element “simple slider” and add a caption like that:then the output of the caption headline is wrong, the h2 tag gets lost:
… instead of looking like this, which is right, when you disable the snippet from the documentation mentioned above:
My site is not yet online, so perhaps you can follow up this issue by adding the snippet from the documentation by your own.
I disabled all other plugins, to avoid any conflicts.NOTE:
I do not use a child theme, I use the parent theme with that snippet and created a “shortcodes” folder in the parent’s root
Maybe a path problem, because I use the parent theme?Any updates on the snippet possible please?
Thanks.August 25, 2018 at 7:26 pm #1001739Hey Gitte,
In order to create custom shortcode elements you need to add the “shortcodes” folder in the child theme path and add the function into the child theme functions.php
Please install the official Child Theme and then recreate the steps above.Best regards,
MikeAugust 26, 2018 at 11:33 am #1001844Hi,
I have made too many changes to the theme, so that a child has not worked any more some time ago.
So I work ONLY with the parent theme, documenting the changes I made in a list – worked for me.So please see again my question above, regarding the parent theme – no child!
Thanks.August 26, 2018 at 2:59 pm #1001884Hi,
OK, can you explain which element you are editing or adding, and can you link to a copy of it to test with via DropBox?
If you are keeping a list of your changes and manually making the changes after each update, why not edit the shortcode element directly in the parent theme folder?
\enfold\config-templatebuilder\avia-shortcodes\[element folder]But I’m very certain that moving the customized shortcode elements, using the function, will only work with a child theme. But I will be happy to test on my localhost if you link to your edited element via DropBox.
Best regards,
MikeAugust 26, 2018 at 4:07 pm #10018921. I use the “simple slider” element:
2. adding 1 image to it:
3. the settings of this image are:
4. Result without the code snippet from documentation in parent’s functions.php:
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
5. when I add the mentioned code snippets to parent’s function.php, then the image caption looks like this: the headline is not right “interpreted”:
6. Source code:
August 26, 2018 at 6:16 pm #1001906Hi,
Thank you for the great step-by-step instructions of what you are trying to do.
But, I believe there is a misunderstand on what the code snippet does, because there is no reason for you to use it for your project, because from your explanation you are not customizing the code of the element.The reason to use the code snippet is when you have changed the code of a element for a special need, and you don’t want to lose the custom code changes when the theme is updated. You don’t seem to be doing this.
If you have made custom code changes to the slideshow.php please share it via DropBox.Best regards,
MikeAugust 26, 2018 at 9:15 pm #1002023I need the code snippet for example for adding other ALB elements like those from https://www.spiderflystudios.com/resources/spiderfly-enfold-elements/ mentioned somewhere else here in the forum. That’s the reason for why I need this snippet in my functions.php
Please refer also to @guenther website here:
On the other hand I need a correct working of the “simple slider” element where the caption headline is displayed right, no matter what else I am doing with any other things.
The fact is, that the code snippet from your documentation interferes with the correct display of a caption headline when using the “simple slider” element like shown in the screenshots above. I do not want to change anything with that element, just the right display of the headline.
August 26, 2018 at 10:51 pm #1002036Hi,
Thank you that makes sense, ok, so I downloaded some of @Guenther files, “Both Full-Sliders and Easy-Slider with h-tag choice at caption” & “White Space Separator with ID Option”
and added them to \enfold\shortcodes\ in the parent theme directory, then I added the function to the bottom of my functions.php:add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
and to my surprise they worked fine.
I then tried repeating the steps above using the Easy Slider and “Both Full-Sliders and Easy-Slider with h-tag choice at caption” with no issues.
Then I removed the files in the \enfold\shortcodes\ but left the function in place, and again I found no issues, the h2 was in place.
I then created a new page and followed your steps above again with only the function in the parent theme functions.php and no added files, but I couldn’t reproduce your error
So I’m not sure what is causing the error for you, perhaps try creating a new test install with no plugins or scripts and see if you can reproduce the error?Best regards,
MikeAugust 27, 2018 at 11:19 am #1002199I haven’t yet added anything from Guenther’s site :-) That was just an intention for me for the future!!
At the moment I just work with a clean ENFOLD and its original elements (“simple slider”).
The only thing that I have done is adding the documentation’s code snippetadd_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
to ENFOLD’s function.php and adding the “simple slider” ALB element to a page – nothing else, no tweaks, just the original ENFOLD.
And yes, i have created a clean test install with the medical demo – no plugin, no scripts, nothing.
The problem might be the code snippet from documentation – perhaps a path problem in it, because I use it with the parent theme, not a child theme.August 27, 2018 at 11:47 am #1002213Hi,
If you place your custom shortcodes in the parent theme directory (wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/) you don’t need this code. You can simply remove it. The code is only required if the template builder must also check other directories (i.e. the child theme directory) for custom shortcodes.
If you want to test this you can i.e. use this code: https://pastebin.com/raw/XfUGF2Jn
Jut copy it into a plain text file and save this file as testshortcode.php (make sure the file extension is .php). Then upload it to the wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/ directory. Then go to the advanced layout builder and you’ll notice a new “Content Element” called “Testshortcode”.Best regards,
DudeAugust 27, 2018 at 1:23 pm #1002266and of course – read carefully.
Please upload all 4 files to your child-themes/shortcodes folder because the av-helper-slideshow.php rules the things for all 3 sliders. If one left original it has a wrong markup.
: because the av-helper-slideshow.php rules the things for all 3 sliders
: and If one left original it has a wrong markup.so you can replace them in parent theme as well – but you will loose those changes on next update of your parent theme.
And – i think you have to pull the replacement files into the right folders ( you don’t need to do that on child-theme)
slideshow – slideshow_fullscreen – slideshow_fullsize
the av-helper-slideshow is on shortcodes folderAugust 27, 2018 at 1:30 pm #1002269but thinking about the code – why does it not work if there is on enfold/shortcodes the substitutes ?
the :$template_url = get_stylesheet_directory();
should work on parent theme as well – or am i wrong.
I guess the whole fault is that all 4 files have to be in there!August 28, 2018 at 7:42 am #1002579Hi,
Probably yes. Tbh I didn’t test this myself because it simply doesn’t make any sense to use this code with the parent theme shortcode directory.
Best regards,
DudeAugust 28, 2018 at 7:58 pm #1002813yes – your are absolutely right – but it has to work – and on parent update these files are not lost.
-
AuthorPosts
- You must be logged in to reply to this topic.