I use disqus to handle comments on my blog.
I also like to have pingbacks from various posts back and forth to each other (and from outside sources.
However, I noticed today that while the comment count at the bottom of a post will show the total number of “comments” (including pingbacks), only the Disqus comments are actually displayed.
How can I get pingbacks to appear as well as Disqus comments?
The plugin you mentioned is only a single function so it shouldn’t be too heavy on your setup. It uses the
comments_template
filter to inject the pingbacks/trackbacks list into your page.But the plugin is using an extra manual SQL query and the template is constructed by hand,
so there’s a room for improvements/simplifications.
A simple demo plugin with
wp_list_comments()
:You can try for example:
If your theme uses a callback then you can adjust the
my_theme_comment
part accordingly. The Twenty Twelve theme uses thetwentytwelve_comment
callback but the Twenty Thirteen and Twenty Fourteen themes do not use such a callback, to my knowledge.The
$type => 'pings'
input parameter is of importance, because it filters out every comment type except pingbacks and trackbacks.Notice that we let
wp_list_comments()
do all the hard work setting up the template.A modular demo solution without
wp_list_comments()
:You could also filter out the pings, from the
comments_array
filter, with:where the main container class is:
and the data source is:
and the layout is defined with:
You can then adjust the layout to your needs.
Here’s an example of the output with this solution implemented:
A solution with an extra
get_comments()
:Another way (with some extra work and queries!) would be to construct the list, with for example:
where
get_comments()
is just a wrapper for theWP_Comment_Query
class. I would probably not go this route and use the other solutions instead.You could also use the
WP_Comment_Query
class directly, but it’s not as sophisticated as theWP_Query
class.I hope this helps.
This will display them before the DISQUS comment form but not the count