1
当我在Wordpress中使用默认的帖子类型时,上面的代码运行良好。但是对于自定义帖子类型,它什么也没有显示。the_content没有显示任何一个costum帖子类型
<?php
$p=$_GET['p'];
header('Content-Type: text/html; charset: UTF-8');
require('../../../../wp-load.php');
$my_query = new WP_Query();
$my_query->query(array('post__in' => array($p)));
if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
echo the_content();
endwhile;
endif;
?>
您的帮助是高度赞赏