Include php / edit file template
Hello,
Is there any way to inlcude some custom php code when editing a page or template?
If not, is possible to add by edit some .php file template on the active theme or child theme?
Thanks.
David.
-
Hello,
Thank you for contacting us.
You can't add a PHP code directly to the editor, but you can add a shortcode element with this code in the editor.
Best regards, Nelea.
0 -
Hi,
So shortcode element works for shortcodes, html, javascript and php?
Thanks.
0 -
Hello,
The Shortcode element is meant for pasting shortcodes. Please use the Embed element for embedding HTML and JavaScript code.
Regards, Nelea.
0 -
Hi Nelea,
But what i need is to add PHP code, not HTML or JS.
0 -
Hi
As mentioned above, WordPress doesn’t allow you to run PHP code in a post or page. However you can try this work around.
- Install 'Insert PHP Code Snippet' plugin.
- Add your PHP code to the plugin
- Paste its shortcode into the Brizy Shortcode element and see if it works
0
Please sign in to leave a comment.
Comments
5 comments