ブログ投稿を引き出し、Wordpressフォルダ外にある私のカスタムsingle.php
ページに表示する必要があります。パーマリンクを上書きし、Wordpressディレクトリの外に投稿データを表示する
私はindex.php
のページで自分の最新のページのリストを取得していますが、permalinkをクリックするとどこも私に送信されません。 permalink はと思っています。これは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'); ?>