Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#10539 closed defect (bug) (invalid)

Comments Pagination Links disappear if you separate comments from pings

Reported by: aldolat's profile aldolat Owned by: apeatling's profile apeatling
Milestone: Priority: normal
Severity: normal Version: 2.9.1
Component: Comments Keywords: needs-patch
Focuses: Cc:

Description

If you try to separate the comments from pings (trackback and pinkbacks), the links to comments pagination (Previous and Next Comments) disappear if they are located after the call to wp_list_comments('type=pings') function.
For example, after this:

<ol class="commentlist">
<?php wp_list_comments('type=comment');?>
</ol>

paste:

<ol class="commentlist">
<?php wp_list_comments('type=pings'); ?>
</ol>

Now, you should not see the links to Previous and Next comments.

Instead, you should continue to see the links located before the wp_list_comments.

Change History (8)

#1 @aldolat
14 years ago

You may also try to copy

<div class="navigation">
	<?php previous_comments_link() ?>
	<?php next_comments_link() ?>
</div>

before AND after this piece of code:

<ol class="commentlist">
<?php wp_list_comments('type=pings'); ?>
</ol>

You'll see that only the first copy will display the links correctly.

#2 @aldolat
14 years ago

  • Cc aldolat@… added
  • Component changed from General to Comments
  • Keywords 2nd-opinion added
  • Milestone changed from Unassigned to 2.9.2
  • Version set to 2.9.1

Can anyone test it?

#3 @nacin
14 years ago

  • Keywords needs-patch added; 2nd-opinion removed
  • Milestone changed from 2.9.3 to 3.0

#4 @apeatling
14 years ago

  • Owner set to apeatling
  • Status changed from new to assigned

#5 @apeatling
14 years ago

This is because the call to

<?php wp_list_comments('type=pings'); ?>

is resetting the internal commenting vars in wp_list_comments() which also resets pagination. The solution is to make sure you call the navigation links before you output pings to avoid the reset. I've tested this and it works.

#6 @apeatling
14 years ago

  • Cc apeatling added
  • Resolution set to invalid
  • Status changed from assigned to closed

#7 @nacin
14 years ago

  • Milestone 3.0 deleted

#8 @aldolat
14 years ago

@apeatling
You're right. Thanks. :)

Note: See TracTickets for help on using tickets.