Wordpress 为什么不是';我的单个帖子模板显示不正确吗?
我想知道如何在wordpress上创建一个自定义的单篇文章模板。我不是很熟悉它,但被要求使用它 我已经按照创建它所需的步骤进行了操作,但是我的新帖子模板educators似乎仍然在引用原始帖子模板,而不是我为其创建的帖子模板 这是我的单post_educator.php文件代码Wordpress 为什么不是';我的单个帖子模板显示不正确吗?,wordpress,custom-wordpress-pages,Wordpress,Custom Wordpress Pages,我想知道如何在wordpress上创建一个自定义的单篇文章模板。我不是很熟悉它,但被要求使用它 我已经按照创建它所需的步骤进行了操作,但是我的新帖子模板educators似乎仍然在引用原始帖子模板,而不是我为其创建的帖子模板 这是我的单post_educator.php文件代码 <?php get_header(); ?> <div class="container-fluid"> <img src="<?php the_field('post_ban
<?php get_header(); ?>
<div class="container-fluid">
<img src="<?php the_field('post_banner','option');?>" style="width :100%;">
<div class="container">
<?php if (have_posts()) :
while (have_posts()) : the_post(); ?>
<?php if( get_field('post_content_right') ) { ?>
<div class="post-right col-sm-6 col-xs-12">
<h2><?php echo get_the_title();?></h2>
<p><?php echo the_field('post_content');?></p>
</div>
<div class="col-sm-6 col-xs-12 post-right">
<a href="<?php echo home_url();?>/#educator" style="font-size:
15px;color:#000000;float:right;font-family: 'calibri';text-
decoration: underline;text-align:right;">Back</a>
<p><?php echo the_field('post_content_right');?></p>
</div>
<?php } else { ; ?>
<div class="post-right col-sm-6 col-xs-12">
<a href="<?php echo home_url();?>/#educator" style="font-size:
15px;color:#000000;float:right;font-family: 'calibri';text-
decoration:underline;text-align:right;">Back</a>
<h2><?php echo get_the_title();?></h2>
<p><?php echo the_field('post_content');?></p>
</div>
<?php } ;?>
<?php
endwhile;
endif; ?>
</div>
</div>
<?php get_footer(); ?>
“style=”宽度:100%;">
我附上了一张照片,展示了它现在的样子,以及我希望它是什么样子:
提前感谢..非常感谢您的帮助文件应命名为:
single-{post_type}.php
所以你的情况应该是这样的
single-post_educators.php
你错过了
s
嗨,乔利奥,这就是你说的文件名吗?至于我的,我叫它single-post\u Educators哦,我刚刚意识到我错过了E将更改它并重试谢谢!嗨,乔利奥,在添加了s之后,模板引用正确,但现在内容没有显示。我可以理解c是什么吗因此?可能会问一个新问题,或者我们可以就此进行聊天。您的初始答案已解决?您应该将此标记为已完成。是的,模板现在有点正确引用。非常感谢。我如何与您进行聊天?