I持つカスタムポストタイプのWordPressで(カスタムポストタイプの詳細ページが見つからず、代わりにsingle.phpページが返され
my_product
)と私は上のクリックしたときに、よりリンクを読みます投稿の詳細を表示しますが、single_product.phpの代わりにsingle.phpページに戻ります。ヘルプは です。 がここに私のコードです:あなたは間違ったファイルを使用している
<?php query_posts(array('post_type'=>'my_product','posts_per_page'=>1,'orderby'=>'rand'));
if(have_posts()): while(have_posts()): the_post(); ?>
<div class="media">
<div class="media-left">
<a href="#" class="post-thumbnail">
<?php if (has_post_thumbnail()) {
the_post_thumbnail();
} else { ?>
<img class="media-object new-pro-slide-img" src="<?php bloginfo('template_url');?>/images/default.jpg" class="img-responsive" alt="..." style="max-width: 200px; max-height: 150px;">
<?php }?>
</a>
</div>
<div class="media-body media-body-white media-body-white">
<h4 class="media-heading"><?php the_title();?></h4>
<p><?php the_excerpt(); ?>
</p>
<a href="<?php the_permalink(); ?>"><b>بیشتر بدانید</b> <i class="fa fa-chevron-left"></i></a>
</div>
</div>
<?php endwhile;
設定でパーマリンクの名前を設定する> permalinks – Khodadad