WordPress.org

Ready to get started?Download WordPress

Forums

Comments per page filter (2 posts)

  1. baranka
    Member
    Posted 1 year ago #

    Hi,

    I'm using theme switch for mobile and I need to override admin setting page_comments so that on my child theme for mobile comments are not paged, even if admin settings has been set to page comments.

    So far no luck finding the hook, any help would be appreciated.

  2. bcworkz
    Member
    Posted 1 year ago #

    There's no hook I know of. How this is handled is partly theme dependent. If you look at the comments.php template, you should see a way to turn the page navigation on and off. That leaves the actual display of comments. This typically is done by calling wp_list_comments(). By changing the arguments array passed to this function on the template, you can override the default handling of comment listing.

    Unfortunately, I don't know exactly what you need to put in the array to make your desired behavior happen. page and per_page are the array keys. Unset, false, null, 0 would be the usual value suspects. But at least you now know where to start playing around.

Topic Closed

This topic has been closed to new replies.

About this Topic