public |-- index.php (外部) |-- post-viewer.php (外部) |-- /WP (wp安装)
我正在尝试从外部页面调用wordpress安装中的帖子。我设法从首页显示帖子标题、摘录、缩略图和帖子内容(通过以下教程:http://codex.wordpress.org/Integrating_WordPress_with_Your_Website)。
当我点击index.php上的帖子标题时,我的浏览器会被重定向到Wordpress站点(我想对公众隐藏这个站点)。
如何让post内容出现在post-viewer.php上呢?
谢谢
发布于 2015-02-24 16:12:48
加载WordPress核心函数并通过get_post选项加载
<?php
require_once("wp-load.php");
$post = get_post( 12 ); // your post id
echo $post->post_content;
?>https://stackoverflow.com/questions/28690466
复制相似问题