Trying add shortcode from a different pluging into wysiwyg field. But it doesn’t work, I heare there is a ” content filter” that should do the work. But where would I find that?
Hi @icovermaface
the_content is not run on the WYSIWYG field, however ACF runsthe do_shortcode function on the value.
Is it possible that you are not using the correct ACF function to load the data and apply the filter?
What code are you using in your template?
Hi @elliot
Below is my code, how it works is I created a filed for ‘title’, ‘txt’ and ‘img’.
Currently the WYSIWG field is being used on the txt section.
<p class=”br-location-dayText txt”><?php echo get_post_meta($post->ID, ‘day_4_text’, true); ?></p>
—this is where the code lives—
<?php if( get_post_meta($post->ID, ‘day_4’, true) ) { ?>
<section class=”br-dayEven”>
<div class=”main-contentWrapper”>
<div class=”br-headlineWrapper”>
<span class=”br-headlineTitle br-dayEven title”><?php echo get_post_meta($post->ID, ‘day_4’, true); ?></span>
</div>
<p class=”br-location-dayText txt”><?php echo get_post_meta($post->ID, ‘day_4_text’, true); ?></p>
<?php if( get_post_meta($post->ID, ‘day_4_image’, true) ) { ?>
” alt=”test” />
<?php } ?>
</div>
</section>
<?php } ?>
Thanks
Your issue is that you are using get_post_meta
For ACF to correctly format any value, you must use the get_field or the_field functions.
Please read the ACF documentation to learn more