【问题标题】:How do I effectively get WordPress comments to display on home page?如何有效地让 WordPress 评论显示在主页上?
【发布时间】:2011-10-21 13:28:37
【问题描述】:

我可以让 cmets 显示在主页上,但我遇到了 3 个相当大的错误。其中一个错误被 if 语句消除了。我正在使用 Yoko 主题。在 index.php 中,我在 <?php get_template_part( 'content', get_post_format() ); ?><?php endwhile; ?> 之间插入了一个代码 sn-p。插入的代码是:<?php if ($withcomments != 1) { $withcomments = "1"; comments_template(); } ?>

我遇到的问题是第一篇博客文章的 cmets 显示在文章本身之外。另一个问题可能与显示cmets无关,所以我不会在这里发布,但它涉及一些与cmets重叠的图片。您可以在 www.flyfishingpursuits.org 上查看(如果它们仍然存在)正在发生的问题。请不要在页面上发布任何 cmets。我正在为其他人这样做,请保持您在网站上的“足迹”不存在。谢谢。

【问题讨论】:

标签: php wordpress debugging wordpress-theming


【解决方案1】:

我会使用 wordpress get_cmets() 函数

http://codex.wordpress.org/Function_Reference/get_comments

【讨论】:

    猜你喜欢
    • 2011-09-06
    • 2012-09-06
    • 2011-03-12
    • 1970-01-01
    • 2014-09-06
    • 2020-01-15
    • 1970-01-01
    • 1970-01-01
    • 2020-02-18
    相关资源
    最近更新 更多