Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 wordpress 中运行一个能够使用所有 WP 标签的外部 php 文件?
是的。您应该只在 PHP 文件的顶部包含 wp-blog-header.php 文件。
include(dirname(__FILE__) . '/../../../wp-blog-header.php');
加载wp-load.php以包含所有 Wordpress 功能。
wp-load.php
但是,请注意错误。