I would like to use php code on wysiwyg editor.
when I write code and then save.
wysiwyg editor always comment my code.
I found Advanced Custom Fields – Code Area Field. but it doesn’t work in repeater field
Did you have this feature in ACF?
You’re going to need to use a plugin to put PHP code into a WYSIWYG field, or build something yourself.
@Hube2 I’m going to build somethings.
Example
I would like to display “10 menus”
I write code in text tab of WYSIWYG filed
<?php echo $count_menu; ?> menus
and then update.
It doesn’t display but code is <!--?php echo $count_menu; ?--> menus
How could I do it?
This is really a general WP question and not specific to ACF. I built a plugin that does this using shortcodes https://github.com/Hube2/blunt-snippets. There are other plugins available that work the same way, like this one: https://wordpress.org/plugins/allow-php-in-posts-and-pages/
As far as entering PHP directly into a WYSIWYG editor, I don’t know how you’d do that and to be honest I don’t think it’s a good idea.
@Hube2 Thank you for suggestion.
I found way to do it.
I created a checkbox field to signal for display.