How Do You Properly Create Child Theme?
-
I needed to add two functions to functions.php for my site in order to remove the WP logo and the PRIVATE string from private pages.
Because I’ve read that I should not tinker with the ‘core’ files in case of ‘updating’, etc., I went the CHILD THEME route.
According to the instructions, I created a new subdirectory under /themes called /twentyten-child.
In this subdirectory, I added a style.css file with the header info:
/*
Theme Name: Twenty Ten Child
Description: Child theme for the Twenty Ten theme
Author: Rixter
Template: twentyten
*/@import url(“../twentyten/style.css”);
Nothing else in this file. No changes to styles, etc.
Then I added a functions.php file into the child theme directory. This is all that it has in it.
<?php
// Rick’s attempt to filtering out PRIVATE
function remove_private_prefix($title) {
$title = str_replace(
‘Private:’,
”,
$title);
return $title;
}
add_filter(‘the_title’,’remove_private_prefix’);/* Rick added this code to remove WP logo menu items */
add_action( ‘admin_bar_menu’, ‘remove_wp_logo’, 999 );function remove_wp_logo( $wp_admin_bar ) {
$wp_admin_bar->remove_node(‘wp-logo’);
}?>
Then in my DASHBOARD under THEMES, I choose my Twentyten-Child theme.
Well, my modifications worked just fine! I was thrilled! My first attempt at this. Woo hoo!
But then, I noticed that when I try to create a POST and click on UPDATE, my page goes blank. I have to go to my sites URL to get back into the DASHBOARD.
What did I miss? Was there something else I have to add to my child theme directory so that everything else works as before?
I assumed that everything in the original Twentyten theme should work as before, except I’ve added two new functions.
Help please.
Thanks in advance.
- The topic ‘How Do You Properly Create Child Theme?’ is closed to new replies.