简体   繁体   English

WordPress的单个帖子不显示内容

[英]Wordpress single post not showing content

My single-posts pages are not displaying any content. 我的单帖页面没有显示任何内容。 I have restored the original single.php from the theme but nothing changed. 我已经从主题还原了原始的single.php,但是没有任何改变。

Contents of single.php http://pastebin.com/ri6C96AX Random post page http://www.crossfitawac.com/onramp-6/ single.php的内容http://pastebin.com/ri6C96AX随机信息页http://www.crossfitawac.com/onramp-6/

These posts are auto-published from Wodify. 这些帖子是从Wodify自动发布的。 I've setup a blog-grid page in the WOD section that is showing the contents of each post, but if I want to see a single post from the website/blog page, the contents are not showing. 我在WOD部分中设置了一个博客网格页面,该页面显示了每个帖子的内容,但是如果我想从网站/博客页面中看到单个帖子,则不显示内容。

Looks like you've got a few issues in your single.php file. 看来您的single.php文件中有几个问题。 Remove do_shortcode() for your title- that is only for using Shortcodes outside of the Content Editor . 删除您的标题的do_shortcode()仅用于在Content Editor之外使用do_shortcode() Instead the Page title is displayed using: 而是使用以下方式显示页面标题:

 <?php the_title(); ?>

Inside your while loops, it's looking for a separate content template file. 在while循环内,它正在寻找一个单独的内容模板文件。 I'd recommend just starting with this and then after you get it working you could then consider moving it to it's own template. 我建议仅从此开始,然后在它开始工作后,您可以考虑将其移至其自己的模板。

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    <h1 class="entry-title"><?php the_title(); ?></h1>

    <div class="entry-content">
        <?php the_content(); ?>
    </div>
</article>
<?php endwhile; ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM