Support

Account

Home Forums Backend Issues (wp-admin) Error reading Shortcodes in wysiwyg editor Reply To: Error reading Shortcodes in wysiwyg editor

  • This worked for me.

    Put this in your functions file:

    <?php 
    function example_sc( $atts ){
    ob_start();
    get_template_part('template','part');
    return ob_get_clean();
    }
    add_shortcode( 'example', 'example_sc' );
    ?>

    Put this in your template file:

    <?php
    if(get_sub_field('wysiwig')):
    $wysiwig = do_shortcode(get_sub_field('wysiwig',false, false));
    else:
    $wysiwig = '';
    endif;
    ?>
    
    <?php echo $wysiwig; ?>