在 WordPress Post 中执行 php 代码

发布于 2024-12-11 08:00:46 字数 382 浏览 3 评论 0原文

我需要

在 WordPress 帖子中编写一些 php 代码,我在这个 http://www.hongkiat.com/blog/execute-php-in-wordpress-post-page-and-widget-sidebar/ 使用 phpexec 插件。

但是老问题就像我在 html 编辑器和可视化(所见即所得)编辑器之间切换一样,它也会改变我的 php 代码和 html :(

那么这个问题的解决方案是什么,我不想禁用我的所见即所得编辑器。

all

I need to write some php code in wordpress post and i found the solution on this http://www.hongkiat.com/blog/execute-php-in-wordpress-post-page-and-widget-sidebar/
using phpexec plugin.

But the old question as if i am switching between html editor to visual (wysiwyg) editor,it will change my php code also html :(

So what is solution for this, i do not want to disable my wysiwyg editor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

燕归巢 2024-12-18 08:00:46

否,当您在可视化编辑器和 html 编辑器之间切换时,它不会改变

no when you switch between visual and html editor, it will not change

猥琐帝 2024-12-18 08:00:46

如果您想在帖子或页面中执行一些 php 代码,您可以使用此插件此插件是免费的
https://wordpress.org/plugins/php-code-for-posts/

you can use this plugin if you want to execute some php code in your post or page this plugin is free
https://wordpress.org/plugins/php-code-for-posts/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文