我没有找到任何正确的答案,没有尝试在互联网上销售模板或 WordPress 添加。
我有一个 WordPress 网站,人们在写文章。我正在寻找解决方案:
到目前为止,我可以在发新帖子时复制模板,但如果我更改模板,它不会更新。
感谢您的帮助
如果您不介意我问您是否使用自定义页面或 single.php - Single.php 会覆盖每个正常帖子并按原样显示它,这是您的问题吗? ,also // 显示你想要的内容 内容();应该显示从块或普通编辑器添加到该页面的任何更改。
https://developer.wordpress.org/themes/basics/organizing-theme-files/
<?php
get_header();
// Start the loop
if (have_posts()) :
while (have_posts()) : the_post();
// Get the author ID
$author_id = get_the_author_meta('ID');
?>
<article>
<h2><?php the_title(); ?></h2>
<p>Posted by <?php the_author(); ?></p>
<div>
<?php
// Display the content you want
the_content();
?>
</div>
</article>
<?php
endwhile;
else :
echo 'No posts found';
endif;
get_footer();
?>