WordPress.org

Ready to get started?Download WordPress

Forums

Pagination for wp_list_comments (1 post)

  1. buaidh
    Member
    Posted 1 year ago #

    For some background, I added a nav-item to the buddypress menu that shows that person's most recent comments, but I can't get pagination links to show up. I've gotten the comments to show and can even limit how many are on a page. My code:

    global $bp;
    $author_id = $bp->displayed_user->id;
    $args = array(
    	'user_id' => $author_id,
    	'orderby' => $order_by,
    	'order' => $order_dir,);
    ?>
    			<div id="CommentListWrapper">
    				<ol class="comment-list">
    					<?php
    // show individual comments	
    
    wp_list_comments('callback=mytheme_comment&type=comment', get_comments($args)); ?>
    </ol>
    
    <div class="comms-navigation">
    <div style="float:left"><?php previous_comments_link(); ?></div>
    <div style="float:right"><?php next_comments_link(); ?></div>
    </div>
    			</div><!-- #COMMENT LIST WRAPPER -->

    with mytheme_comment function:

    [code moderated - the forum limit for posting direct is 10 lines; for anything more, please use the pastebin]

    Things I've tried:

    • enabled comment pagination in the Discussion admin options
    • setting the per_page for wp_list_comments
    • using paginate_comments_links( ) instead of using the individual next and previous functions

    No matter what I do the pagination links will not appear. I can see different pages of comments by setting the "page" option in wp_list_comments, so I know they exist. The links for pagination just won't show. Any help would be greatly appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic