-
AuthorPosts
-
August 31, 2021 at 9:02 am #1319076
Hi,
I have the same problem as in this thread https://kriesi.at/support/topic/do_shortcode-issue-on-visual-builder/, but it’s on a different template.The solution provided by Ismael was using
Avia_Builder()->compile_post_content($post);
but that is not working for me since the template where this is going to be executed is a Search&Filter-Resulttemplate.Is there a way to add the “Avia_Builder()”-object somehow in a custom file?
September 1, 2021 at 12:51 pm #1319339Hey emilconsor,
Thank you for the inquiry.
Are there any errors when you try to use the compile_post_content function? We are not sure how the plugin loads the search-filter template but the following code might work.
require_once( get_template_directory() . '/config-templatebuilder/avia-template-builder/php/class-template-builder.php' ); global $post; $builder = Avia_Builder(); $builder->compile_post_content($post);
Best regards,
IsmaelSeptember 6, 2021 at 9:05 am #1319845Hi Ismael,
that looked good, but unfortunately, we don’t pass the $post as post. We have a preview text within the post with shortcodes – these are the ones getting displayed in the results. Is there something similar to compile_post_content but taking a String (with shortcodes)?
Thanks in advance!
RegardsSeptember 9, 2021 at 2:53 am #1320153Hi,
Thank you for the info.
Using the do_shortcode function might be enough to properly render the shortcodes that is within the $content but first you will have to allow builder elements to be executed outside the ALB or the builder. Try to add this 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 );
Best regards,
Ismael3ff3September 27, 2021 at 8:37 am #1322421Hi Ismael,
sorry for the late reply.
We already have that snippet in our functions.php, but that didn’t work.Regards
- This reply was modified 3 years, 1 month ago by emilconsor. Reason: Typo
October 1, 2021 at 12:48 pm #1323142Hi,
Sorry for the delay. Is there a staging or development version of the site where we can see the issue? Please post the WP and FTP details in the private field. And please include a direct link to the page where you are testing the modification so that we can see how it currently works.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.