Adding a LISTING of PHP code in a page/post [closed]
You can’t put PHP code in a post, without the use of plugins that allow that. You might be able to put a <code></code> tag around the code in a text editor, but that might depend on your theme. But the code in your question looks like it belongs in the functions.php of your theme … Read more