[theme-reviewers] Friendly request? About themes comments section

Justin Tadlock justin at justintadlock.com
Thu Oct 23 15:37:01 UTC 2014

If you go back and look at some of the original themes or even in the
`wp-includes/theme-compat/comments.php`, you'll notice this is how it's
done and has always been done as far as I can remember.  The `#comments`
section isn't shown until there are actual comments.

This is why I'd consider `comments_link()` and `get_comments_link()` the
inappropriate functions when there are no comments for the post. You'd be
linking to something that does not yet exist.

I'd use `comments_popup_link()` instead, which will display a link to
either `#comments` or `#respond` depending on the situation.  This function
also takes into account things like whether comments are open, pings are
open, or a password is required before showing the link.

On Thu, Oct 23, 2014 at 5:47 AM, Philip M. Hofer (Frumph) <philip at frumph.net
> wrote:

> comments_link()   get_comments_link() appends #comments to the end of the
> url
> If  the comments section displaying on the single pages/posts does not
> have a id="comments" then the comments_link appending of the #comments is
> worthless .. I see quite a few themes that only have the #respond section
> but not the wrapper around it for #comments
> The most common reason is that dev's have it so that it's in the part of
> the comments.php section that only shows up when the post actually has a
> comment made for it ..
> ^ which it shouldn't, then it's not seen or used as a ref.  for the
> #comments in the comments_link;   it should be the class for the wrapper
> for the whole entire comments section - or at least shown as a marker
> location regardless if the post has comments or not
> - Phil
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20141023/2a808221/attachment.html>

More information about the theme-reviewers mailing list