我正在与一个博客页面自定义可湿性粉剂主题。博客页面显示了帖子,但当您单击每个帖子时,它会将您带到一个空页面。
我已经设置了:设置>发布页面>博客
基本上,博客页面显示所有内容,但博客帖子页面是空白的。这是我的index.php。
<div class="header-img-container container-fluid">
<img
class="header-img"
role="banner"
src="http://cc.local/wp-content/uploads/2020/04/blog-page.jpg"
>
<hr class="horizontal-line">
</div>
<div class="container">
<div class="row">
<div class="col">
<div class="vertical-center">
<form action="http://cc.fullslate.com/">
<button class="appointment-button btn button">Schedule</button>
</form>
</div>
<p class="page-body-title">Blog</p>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
if ( have_posts() ) {
// Load posts loop.
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content/content' );
}
// Previous/next page navigation.
//cc_the_posts_navigation();
} else {
// If no content, include the "No posts found" template.
get_template_part( 'template-parts/content/content', 'none' );
}
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
</div>
</div>
</div>发布于 2020-05-02 03:44:11
如果你想编辑单个帖子的视图,你需要在wordpress:https://developer.wordpress.org/themes/basics/template-hierarchy/中使用single.php查找更多关于模板层次的信息
下面是它应该是什么样子:https://developer.wordpress.org/themes/template-files-section/post-template-files/
您可以根据需要调整此single.php,它将按原样工作,因为其中包含post循环。
https://stackoverflow.com/questions/61529478
复制相似问题