繁体   English   中英

WordPress包含无效

[英]WordPress includes are not working

为什么以下各项根本不起作用?

<?php include( get_template_directory_uri() . 'include/product-search.php'); ?>

我的wp-content/themes/theme/include/wp-content/themes/theme/include/

我也尝试了不使用_uri和许多其他选项,但是我可以使用它。

它显示在页面的<p></p>标记内,但仅此而已...

require_once WP_CONTENT_DIR.'/themes/your_theme_name/include/product-search.php';

好吧,事实证明您无法在文本编辑器中将PHP代码添加到页面中。

也许下次,就是不要使用WordPress,数百个随机问题和仅需要一个插件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM