Adding WP-PostRatings to Thematic by creating a Child Template (WordPress)

As my previous post says, I wanted to add the WP-PostRatings plug-in to all posts in a Thematic theme. Later I found out that the recommended way of doing this is through WordPress Child themes.
So I read in this aricle the basics of how to create and customize a child template.
Basically the steps to include the plug-in are the following:

  • You start with an untouched Thematic theme
  • Go to wp-content/themes/thematic/
  • Move the thematicsamplechildtheme folder one level up (to wp-content/themes/) and rename it by preference. You just created your new Child Theme.
  • You may modify the template’s name by editing the style.css file’s first few lines.
  • To add the previously installed WP-PostRatings plug-in to the theme, edit the functions.php file and add the following to the file’s end. I copied the function from the parnet theme’s content-extensions.php file.
post\_type == 'page') {
    $postheader = thematic\_postheader\_posttitle();        
}
else {
    $postheader = thematic\_postheader\_posttitle().thematic\_postheader\_postmeta();    
}
     
echo apply\_filters('thematic\_postheader', $postheader); // Filter to override default post header
if(function\_exists('the\_ratings')) { the\_ratings(); } // This command will actually insert the ratings in each post.
}
?>

Enjoy your new theme and I wish you high ratings! :-)

Originally posted to: http://www.thesysadminhimself.com/2011/03/adding-wp-postratings-plug-in-in.html

Updated:

Comments