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

    #1226708

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

    #1229939

    Hi 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?

    #1230596

    Hi,

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

    #1232756

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

    #1233384

    Hi,

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

    #1233467

    Hi,
    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?

    #1234042

    Hi,

    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

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