How to separate trackbacks from comments - Profit Hunter

How to separate trackbacks from comments - Profit Hunter I just read an article by Michael Martin on how to clear comments from trackbacks and pingbacks, and, in fact, already made all the necessary changes to the template. (It took me about 10 minutes to do everything about everything.)

I hope you find this useful too.

1. Open the comments file. php and find the line

. ? php foreach ($ comments as $ comment):?.

2. Immediately under this line insert the code

. ? php $ comment_type = get_comment_type (); ?
. ? php if ($ comment_type == 'comment') {?.

3. Now find the line

. ? php endforeach; / * end for each comment * /?

4. Directly before insert the code

. ? php} / * End of is_comment statement * /?.

Thanks to such simple manipulations, you will clear the comments from the trackbacks, for which we will now make a separate loop.

1. Find the line

. ? php else: // this is displayed so far?

2. Insert before the code

. h3. Trackbacks. / h3.
. ol.
. ? php foreach ($ comments as $ comment):?.
. ? php $ comment_type = get_comment_type (); ?
. ? php if ($ comment_type! = 'comment') {?.
. li. . ? php comment_author_link ()?. . / li.
. ? php}
. ? php endforeach; ?
. / ol.

The string . h3. Trackbacks. / h3. you can delete or change at your discretion.

As they say in America, enjoy 😉

Hosting for blogs with WordPress pre-installed

Related Posts:

  • 10 habits of successful bloggers
  • List of free Web 2. 0 platforms
  • How to increase conversion
  • Back to the Future - Web 2. Perspectives. 0

Like articles? Subscribe to the newsletter!

Search

Related Articles