【发布时间】:2017-01-30 22:47:08
【问题描述】:
我需要拉出一篇博文并显示在位于 Wordpress 文件夹之外的自定义 single.php 页面上。
我有一个index.php,该页面会拉出我最近页面的列表,但是,单击永久链接却无处可去。永久链接认为它在 Wordpress 文件夹中,所以链接是相对的。
我只想要 index.php 永久链接,点击后将用户带到我的博客文件夹外的single.php 并显示该帖子。
这是我到目前为止所拥有的,但我不知道如何让他的永久链接将用户发送到我的single.php 页面
我的文件夹结构可帮助您可视化我的布局
+ /blog/
- All the standard wordpress stuff in this folder
- index.php (shows recent)
- single.php (where I want the user to go)
single.php
<?php include_once('_header.php');
require_once(constant('ROOT') . '/blog/wp-load.php');
?>
<div class="row">
<div class="col-sm-12">
<?php
if ( have_posts() ) : while ( have_posts() ) : the_post();
get_template_part( 'content-single', get_post_format() );
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; endif;
?>
</div> <!-- /.col -->
</div> <!-- /.row -->
<hr/>
<?php include_once('_footer.php'); ?>
【问题讨论】: