Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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?

    #1319339

    Hey 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,
    Ismael

    #1319845

    Hi 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!
    Regards

    #1320153

    Hi,

    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,
    Ismael3ff3

    #1322421

    Hi 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
    #1323142

    Hi,

    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

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