Support

Account

Home Forums Add-ons Flexible Content Field Using shortcodes with the flexible content loop Reply To: Using shortcodes with the flexible content loop

  • I ran into this issue and this article helped http://kovshenin.com/2013/get_template_part-within-shortcodes/.

    1. Put the loop in a php file.
    2. Then set up your shortcode like this:
    function myshortcode( $attr ) {
    ob_start();
    get_template_part(‘php’,’file’);
    return ob_get_clean();
    }
    add_shortcode( ‘shortcode’, ‘myshortcode’ );