Making it Thematic

I found a theme I really liked – MaxisNow’s ThreatToCreativity.  But I wanted the blog I was working on to be a thematic blog with a child theme.  So, with hats off to Max, I began scraping his style together into a nice, well-behaved child theme.  It was good fun.

There were a few challenges, but I found my way around okay.  One of the cool things I learned is how to overcome the default loops built into thematic and give them the desired style, structure, etc.  The trick is to look at the loop in the content-extensions.php file of the main thematic theme, and find the loop you want to use.

Here’s the first few lines of the index loop:

 

// The Index Loop
if (function_exists(‘childtheme_override_index_loop’))  {
function thematic_index_loop() {
childtheme_override_index_loop();
}
} else {
function thematic_index_loop() {

Note that first line.  That line looks in the functions.php of your child theme for a function called “childtheme_override_index_loop,” and if it finds it, it inserts it as the function thematic index loop.

So to get started, you scrape the entire function, starting just below the  } else { above, and paste it into your functions.php, and change the name of the function to “childtheme_override_index_loop.”  Now you are in control of the index loop.  You can give it the desired classes, etc. to style your theme as you wish.  In my case, I opened Max’s index.php, and simply scraped his structure to style the boxes, and I was half-way home.  Of course, you have to watch out for the extra brackets – you have eliminated an if/else loop, but you have scraped the function and pasted it along with the extra } at the end of the function.

I had to do exactly the same exercise for the archive loop and category loops.

I was going to use a nifty little if / else arrangement to push the single and page styles using the same index loop, but I got tired of messing with it and simply copied max’s page.php and single.php files into my child theme.

At some point, the post_thumb stopped working, so I had to go grab a different way of calling the post’s thumbnail.

Max had used the typical routine in his functions.php:

 

<?php function post_thumb() {
$files = get_children(‘post_parent=’.get_the_ID().’&post_type=attachment&post_mime_type=image’);
if($files) :
$keys = array_reverse(array_keys($files));
$j=0;
$num = $keys[$j];
$image=wp_get_attachment_image($num, ‘thumbnail’, false);
$imagepieces = explode(‘”‘, $image);
$imagepath = $imagepieces[1];
$thumb=wp_get_attachment_image($num, ‘thumbnail’, false);
print “$thumb”;
endif;
}
?>

That worked in the early development stages, but with all the futzing around, toward the end, no matter how much I messed around trying to fix it,  I got….nothing.  So I found and used the far more elegant :

<?php echo get_the_post_thumbnail($page->ID, ‘thumbnail’); ?>

I hope you get the chance to mash a style you like into the thematic framework.  It’s worth the trouble.

Here’s my outcome:  Audace

PS.  Funny, I just noticed in Max’s description of his theme, he calls it “audacious.”  Yes, it is.  I was tinkering around with names for the theme I was working on and came up with “L’Audace,” without having seen Max’s description.  Cool.

Share