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


Error reading Shortcodes in wysiwyg editor

  • Hi

    I have the Advanced Custom Fields Installed on a website. We have a few fields for each page: Header text (editable using the WordPress editor), header image, and a more info and testimonials page: the last 2 are edited using the WYSIWYG editor form ACF

    I have been asked to add a gallery image which is installed on our site. However, when I type in the shortcode [matrix 2 /], the editor just display the shortcode in text.

    It works ok on the WordPress editor, but we need it further down the page. Is there a workaround so I can enable the shortcode to function correctly in the WYSIWYG editor?

    Please could anyone advise? I have some knowledge of PHP and MySQL and can follow step by step instructions.

    Many thanks in advance.

  • I tried the above PHP – no joy.

  • This worked for me.

    Put this in your functions file:

    function example_sc( $atts ){
    return ob_get_clean();
    add_shortcode( 'example', 'example_sc' );

    Put this in your template file:

    $wysiwig = do_shortcode(get_sub_field('wysiwig',false, false));
    $wysiwig = '';
    <?php echo $wysiwig; ?>
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Error reading Shortcodes in wysiwyg editor’ is closed to new replies.