Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的例子在这里
我正在自定义默认模板,但有些地方没有正确放置。想不通。
顺便说一句,我在这里而不是在 WordPress 上问这个问题,因为坦率地说,就响应时间而言,他们的论坛很糟糕。Stackoverflow 一直对我有好处:)
如果没有看到 php 代码,就很难知道为什么。你有一个单独的帖子模板,即singlepost.php吗?如果是这样,请确保将 sidebar.php 包含在其中。
看起来默认主题中的 single.php 默认情况下不会拉入侧边栏。您需要在 single.php<?php get_sidebar(); ?>之前添加<?php get_footer(); ?>或删除 single.php 和 wordpress 将使用 index.php 代替它有侧边栏。
<?php get_sidebar(); ?>
<?php get_footer(); ?>