WordPress.org

Ready to get started?Download WordPress

Forums

Parameters for wp_list_comments() in 2.7? (14 posts)

  1. Charity Ondriezek
    Member
    Posted 5 years ago #

    Maybe I'm missing something but shouldn't there be a way to control some of the output of wp_list_comments? Date format and avatar size come to mind first, but also whether or not the word "Says" follows every commentator's name. It's nice to have a new template tag for comments instead of a complicated foreach loop, but not at the cost of being able to customize the way comments display. :(

  2. MichaelH
    Member
    Posted 5 years ago #

    Might take a look at Otto's WordPress 2.7 comments enhancements article for explanations of some of the 2.7 stuff.

  3. Charity Ondriezek
    Member
    Posted 5 years ago #

    Thanks Michael, I've actually been sifting through that one. Otto does a great job of explaining how to make a theme compatible and even mentions that the tag has parameters, but doesn't actually cover what they are. Guess I'll have to be patient and wait for the official release and subsequent codex documentation..

  4. Matt Brett
    Member
    Posted 5 years ago #

    I'm not sure what all of them are, but I went digging into /wp-includes/comment-template.php yesterday trying to track down the parameters for wp_list_comments myself. Here's what I found...

    walker
    max_depth
    style
    callback
    end-callback
    type
    page
    per_page
    avatar_size
    reverse_top_level
    reverse_children

    You can use them within the wp_list_comments function call in your comments.php template, similar to how most others...

    <?php wp_list_comments('avatar_size=48&type=comment'); ?>

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    There's a few more useful params in deeper down functions that get passed along through wp_list_comments as well.

    reply_text to set the text of the Reply link for each post.
    login_text to set the text for login to reply (if you require that)
    before and after, for text surrounding either of those.

  6. Peter Michael
    Member
    Posted 5 years ago #

  7. danblee
    Member
    Posted 5 years ago #

    Thanks for the update on this. I'm trying to get some information on wp_list_comments in 2.7 myself. I was hoping to find a very easy way to edit the text of the posters actual comment with some css but the class id for the comment post is something like 12 sentences long and pretty confusing for a theme editing newbie such as myself.

  8. Charity Ondriezek
    Member
    Posted 5 years ago #

    @Matt - thank you! Your entry prompted me to look again at comment-template.php. My question was answered there. I'll elaborate in case anyone else is trying to figure this out...

    I wanted to get rid of "says" which appears behind each commentator's name. I probably should have been more specific in my opening thread, sorry everyone. Anyway I don't think that little bit of text should be forced in the new template tag, and frankly it was really bugging me. For some reason though, I couldn't see if there was a class attached to that text (tried both the Web Dev toolbar and Firebug). After another look at the core template I saw that there is.

    So for anyone else who doesn't want that either (trivial as it may be) and who also doesn't want to mod a core file, add this to your stylsheet: .says{display:none;}

  9. Carbon-12
    Member
    Posted 5 years ago #

    the new comment system isnt working for me at all...

  10. Jesse Friedman
    Member
    Posted 5 years ago #

    @MattBrent - thanks for the info

    To add to @MattBrent's post - if you have the skills you can go into /wp-includes/comment-template.php and edit the layout of the html to better suite your design. I had to do that today.

  11. lexhair
    Member
    Posted 5 years ago #

    The codex is still a little light on this topic. This thread is quite useful.

  12. pixelgeek
    Member
    Posted 5 years ago #

    You can use a callback function to edit the comment formatting to match your own particular style

    http://codex.wordpress.org/Template_Tags/wp_list_comments

    Seems like overkill to use for some simple edits though

  13. hotrod01
    Member
    Posted 5 years ago #

    Hello,

    Does anyone know how to reverse order comments in the inove theme? By reverse order I mean showing the most recent comment at the top. Thanks.

  14. Herudea
    Member
    Posted 5 years ago #

    hotrod01 - in Admin, go under settings, and then discussion. you should see a drop down allowing you to choose which way comments are sorted.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.