Categories
General

How to change things on the comment template

In my case, I wanted to change the text in the new threaded comments from “Reply” to “Reply to this comment” – sounds simple enough, right?

First: Grab the example function from this Codex page and add it to your theme’s functions.php file, changing the function name to suit.

Next: Locate the wp_list_comments function call in your theme’s comments.php file. If you don’t see it there you’ll need to consult the Codex to get your theme up to date. Once you’ve found or added that function call, change it to use your new custom function instead of the default, like this:

wp_list_comments('type=comment&callback=mytheme_comment');

Finally: It’s clear enough how to modify the function to do some things, but in my case I wanted WP’s comment_reply_link function to display “Reply to this comment” instead of just “Reply” – it’s not clear how to do that though. The example function takes some arguments, so I decided to poke around to see if maybe it accepts more. Turns out you can set a custom reply_text by adding to the array of arguments like this:

comment_reply_link(array_merge( $args, array('reply_text' => 'Reply to this comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])))

Other defaults include: add_below, respond_id, login_text, depth before after. Not sure what they all do yet…

Update: The get_avatar call in the example function from the Codex has a placeholder $default set, so it doesn’t work right for users without gravatar accounts. I just removed the placeholder so my get_avatar call looks like this instead:

< ?php echo get_avatar($comment,$size='48'); ?>

Categories
General

Brownies

Brownies

Every time I make ice cream I wonder what to do with the egg whites. I sometimes make macaroons, but usually I put them in a bowl in the fridge and them dump them down the sink a few days later, feeling guilty. Usually I use whole eggs to make brownies, but this time I decided to try it with egg whites. I took notes on the ingredients…which you can assume are very approximate.

Ingredients

  • 9 egg whites
  • 2 tablespoons cocoa powder
  • 1/2 stick butter (salted because that’s what was in the fridge)
  • 2 ounces of unsweetened chocolate
  • 3/4 cup honey
  • 1 teaspoon or so vanilla

Butter some pans and set the oven at 350 F. I microwaved the butter and chopped chocolate for about 30 seconds to melt, then mixed them until smooth. I don’t know if that’s the best way to melt chocolate, but it works for me. Meanwhile, I whisked the egg whites, cocoa, honey, and vanilla. This was dumb because the cocoa powder ended up getting all over the place. Maybe mix the cocoa and honey together first? Anyway, get it all well beaten together, add the chocolate and beat some more, and pour it into the pans. My batter came about 2/3 the way up the pans and that’s about as high as I’d go to avoid overflowing. I baked them for 25 minutes total, then let them cool very slowly in the still-warm oven. The centers were still a little jiggly after 25 minutes. The only downside of the egg whites was cosmetic – there was a thin layer of unmixed cooked egg white at the bottom of each pan. I think the lack of yolk keeps the egg from staying completely mixed with the fatty chocolate and butter. Great with ice cream though, and way better than dumping those egg whites down the drain!

Categories
General

Photopress 1.5.2

This little update adds an option to choose from a couple of different sorting options for the categories on the main album page (requested by Ron). I put the option on the Settings:Photopress page, but might move it to the Tools page later. This version also fixes a bug where changing the category dropdown on the Mass Edit page wasn’t doing anything. Finally, I changed the version number of the widget to match the plugin itself, fixing the “upgrade” problem that Steven Alm noticed.

Download: photopress_1.5.2.zip

Categories
General

Subscribe to Comments plugin hack

Mark Jaquith’s Subscribe to Comments works very well for keeping group blog users aware of comments between visits to the site. However, with comment threading enabled, the links to comments in the emails it sends out are a bit inconvenient – they don’t lead to the comment that’s quoted in the email, which means you must scroll around looking for the comment if you want to reply to it. This hack just adds a link straight to the comment. I submitted a ticket too, so maybe this will be added to the next version.

Insert this at about line 602, just after the code for the regular comment link:

$message .= __("Jump straight to this comment:n",'subscribe-to-comments');
$message .= get_comment_link($comment->comment_ID) . "nn";

Categories
General

flickrpress 0.4

The flickrpress template function was broken because I didn’t update it to work with the updated phpFlickr class. Since I just figured out how to write a widget for Photopress, I decided to write a flickrpress widget while I still know how to do it. Using the widget or the template function your sidebar can have a column of your recent flickr photos like this:

flickrpress widget screen

Download flickrpress 0.4: flickrpress_0.4.zip