-
AuthorPosts
-
June 26, 2020 at 9:33 pm #1225983
Hey,
is there a way to create a custom single page for the blog with a mixture of Enfold shortcodes and ACF shortcodes?Enfold shortcodes are not executed within the single.php file. Even with the hooks function I can’t get anywhere, because it doesn’t execute Enfold shortcodes either. My goal is to use pure code to create a complete single view for the blog and other CTPs with Enfold Shotcodes and other shortcodes.
Maybe there is a way to do this.
June 30, 2020 at 12:19 pm #1226708Hey conflock,
Thank you for the inquiry.
The builder is set to not execute shortcodes outside the builder by default, but that behavior can be changed using this filter.
// https://kriesi.at/support/topic/trouble-with-the_content-and-advanced-layout-editor/#post-1119884
Set it to return true in any case, then you should be able to add the shortcodes in the template.
Best regards,
IsmaelJuly 13, 2020 at 1:17 pm #1229939Hi Ismael,
sorry, but I have no idea how to apply that. I want to use avia shortcodes in a custom single.php and the post you are referencing to didn’t help me at all.
Is there any example how to apply the filter?
July 15, 2020 at 1:38 pm #1230596Hi,
Sorry for the confusion. Try to add snippet in the functions.php file.
function avf_custom_exec_sc_only_mod( $exec_sc_only, $obj_sc, $atts, $content, $shortcodename, $fake ) { return true; } add_filter( 'avf_alb_exec_sc_only', 'avf_custom_exec_sc_only_mod', 10, 6 );
This should allow the theme to execute shortcodes outside the builder.
Thank you for your patience.
Best regards,
IsmaelJuly 23, 2020 at 7:21 pm #1232756Hi,
this has absolutely no effect. All shortcodes inside the single.php (using the do shortcode function) are still output as pure text.Best regards, Julian
July 26, 2020 at 6:15 pm #1233384Hi,
Thank you for the update.
Are you using the do_shortcode function in the template?
// https://developer.wordpress.org/reference/functions/do_shortcode/
Best regards,
IsmaelJuly 27, 2020 at 10:07 am #1233467Hi,
In the meantime I managed to get some shortcodes running in this way:$variable= do_shortcode(“[shortcode]”);
echo do_shortcode($variable);Nevertheless when I use the “include page” shortcode in this way I get very strage results. The page is inlcuded but many functions like for example the lightbox doesn’t work etc..
Is there a better way to use the avia shortcodes?
July 30, 2020 at 4:17 am #1234042Hi,
You may want to refrain from using the Post Content shortcode and instead include the shortcodes directly in the templates to avoid any unintended behavior.
Is there a better way to use the avia shortcodes?
As you may have noticed, builder elements are based on the shortcodes API, so you would have to treat them as you would other shortcodes.
// https://css-tricks.com/snippets/wordpress/shortcode-in-a-template/
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.