Support

Account

Home Forums General Issues Wysiwyg field not displaying in the blog post.

Helping

Wysiwyg field not displaying in the blog post.

  • Hello, I want to insert a [kenplayer] shortcode to the AMP version of my blog, so I created a wysiwyg custom field, when I edit the post, appears the field where I put the shortcode. The problem is that when I open the blog post, the field does not displays at all.

    I inserted the <?php the_field(‘wysiwyg_test’); ?> that appears in the tutorial in the single.ph of my wordpress template this way:

    <div class="entry-content rich-content">
    					<?php the_field('wysiwyg_test'); ?>
    					<?php the_content(); ?>
    					<?php wp_link_pages(array('before' => '<p class="entry-nav pag-nav"><span>'.__('Pages:', ºdp').'</span> ', 'after' => '
    ', 'next_or_number' => 'number')); ?>
    				</div>

    Did I miss something that prevents the thing from working?

  • If you want to insert shortcode and have it show on the front end, use a Text field and then use this in your template:

    
    <?php $shortcode = get_field( 'your_text_field' ); ?>
    <?php echo do_shortcode( $shortcode ); ?>
    

    That’s how I do it. The WYSIWYG field will strip out shortcodes.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Wysiwyg field not displaying in the blog post.’ is closed to new replies.