I decided to host my blog using WordPress for a few reasons. Mainly because it’s mature (read “debugged”) and feature-rich. However, the most important reason may be because it’s written in PHP and I hate PHP. It’s such an unstructured, inconsistent mess. Because I hate PHP, I won’t be tempted to tinker with the code that runs my blog. I’ll focus more on the content I write for my blog, which is the entire point of blogging. That, and to focus on the thought process necessary to conceive of and produce interesting, clearly-written content.

Most everything I want to customize in WordPress I can in the dashboard’s configuration pages for themes, CSS, widgets, and plugins. However, in the theme I chose, I cannot figure out how to customize a few items.

  1. Change the by-line of a blog post from a username (my login name) to a friendly name (Erik Madsen).
  2. Change the size of Gravatar icons displayed next to comments.
  3. Enable shortcodes (for use by plugins) in the right sidebar and comments.
  4. Hyperlink featured images to their blog post.

I resorted to hacking the PHP source code to customize these items. Which I really hate to do for the reasons stated above, but also because it likely will be overwritten by theme updates. So I’m documenting the hacks here in case I need to reapply them.

Alter Post By-Line

Edit the /site/wwwroot/wp-content/themes/flare/inc/template-tags.php file. Change user_nicename to display_name.

Alter Size of Gravatar Icons

Edit the /site/wwwroot/wp-content/themes/flare/comments.php file. Change 32 to 64.

Enable Shortcodes and Featured Image Hyperlinks

Edit the /site/wwwroot/wp-content/themes/flare/functions.php file. Add the following lines at the end of the file.

Leave a Reply

Your email address will not be published.