Giving Hipwords some GPL Love

GPL has not always been my favorite license. This feeling got worse when my daughter’s Minecraft server got shot down by a DMCA takedown of the server code she was running. If you have never read about this, you probably should.

But I do respect copyright and licensing, big-time. And since my favorite-at-the-moment WordPress theme is licensed under GPL, I should probably do the right thing and post my minimal PHP changes here. And that also gives me a chance to test out Crayon Syntax Highlighter!

<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
<?php if (is_front_page()) { ?>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
<?php } ?>

<?php if ((!is_home()) and !(is_archive())) { ?>

<?php the_title( sprintf( '<h2 class="entry-title site-title"> Talks about ', es
c_url( get_permalink() ) ), '</h2>' ); ?>
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
	<?php the_time('l, F jS, Y') ?>
	<?php the_category(', ') ?>
</div><!-- .entry-meta -->
<?php endif; ?>
<?php } ?>
<?php if (is_archive()) { ?>
		the_archive_title( '<h2 class="site-title"> Thoughts on ', '</h2
>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' )
<?php } ?>

What you’re looking at are the modifications I made to header.php in order to change the site titles of all archive and search pages to something more egotistical. header.php and footer.php were the only pieces of the Hipwords theme that I had to override directly, rather than using the preferred WordPress theme extension mechanism : child themes.

Child themes are amazingly simply to use, and they quite frankly do more than I had a right to expect them to do. You simply create your own folder and create a functions.php and style.css in a way that has been described well in other spaces.

I exploited a surprising feature when I wanted to change just a small bit of the header and the footer : It turns out that if you copy any PHP file, like one corresponding to archive or static pages, from the parent theme into the child folder, the WordPress engine loads that file preferentially. I utilized this behavior to copy-and-modify the footer to make one final change…

<a href="<?php echo esc_url( __( '', 'hipwords' ) ); ?>"><?php printf( __( 'Powered by %s', 'hipwords' ), '<b>WordPress</b>' ); ?></a>
<span class="sep"> | </span>
<a href="<?php echo esc_url( __('', 'hipwords') ); ?>" title="<?php esc_attr_e('', 'hipwords'); ?>">
<?php printf( __('Theme: <b>HipWords</b> by %s.', 'hipwords'), '' ); ?>

/* ... That was the old, here is the new ... */

> &copy; <?php echo date("Y"); ?> Michael Johnson

That’s right. I replaced their credits with the copyright notice. Well, it’s not like I’ve been quiet about how awesome Hipwords is!

Parting thoughts: I would really love to pass on this child theme, small though it may be, on to other software developers in need of a blogging platform. This would involve some up-front work and maintenance commitment on my part. Up front, I would need to finish customizing the theme and create a downloadable package to submit to the free WordPress repository. In maintenance mode, I would need to at least monitor security issues and make sure I did my part to keep the web safe. I’m not sure if it is worth the effort.

Have thoughts? Leave them in the comments!