I did query this before as I wanted to remove support for the custom background, backgrounds are not supported, so there was no way.
The thumbnail support is not added with actions or filters, nor did the theme creators wrap them in a function with the if ( statement.
However, there are two arguments you can pass to add_theme_support().
<?php add_theme_support('post-thumbnails'); ?>
There is also a function remove_theme_support(), not sure if it works in reverse, try adding nested inside you child themes after_setup_theme function.
/* Remove theme support for Post Thumbnails */
function remove_custom_theme_support(){
remove_theme_support('post-thumbnails');
}
add_action( 'after_setup_theme', 'remove_custom_theme_support', 11 );
Other Information
This part may help others wondering about the same issues.
Remove Filter and Remove Action
These can only be used in a child theme if add_filter or add_action was used in the parent.
As an example the widgets are loaded with an add_action call, so if you wanted a child theme with no widgets, or you wanted your own widget names, inside ‘after_setup_theme’, you would remove twenty ten’s and create your own.
Parents functions.php has these lines:
/** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'twentyten_widgets_init' );
In the child themes after_setut_theme function we might want to remove the twenty ten widget areas.
/* Remove the Twenty Ten registered sidebars */
remove_action( 'widgets_init', 'twentyten_widgets_init' );
After which we might want to add back our own widget areas.
/** Add our Widgetized Areas */
function child_widgets_init() {
// Load our Widget Area Names and ID's into an Array
$widgets = array (
array(
"name" => "Sidebar One",
"id" => "sidebar-1"),
array(
"name" => "Sidebar Two",
"id" => "sidebar-2"),
);
/* Loop through the array and add our Widgetised areas */
foreach ($widgets as $widget) {
register_sidebar( array(
'name' => __( $widget['name'], 'twentyten' ),
'id' => $widget['id'],
'description' => __( $widget['name'] .' Area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => '</li>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
}
/** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'child_widgets_init' );
Functions
If in the parent theme the function starts with, if ( !
Example could be you wanted to copy the comments code to the child and change it, in the parent it starts:
if ( ! function_exists( 'twentyten_comment' ) ) :
So you can copy this function across to the child and change it, this function with the same name would be placed after the after_setup_theme function and not inside.
WordPress runs the childs functione.php first, so it would then load the function ‘twentyten_comments’ from the child theme.
When it runs the parents functions.php it would see that the function is already loaded and skip it.
You cannot have a function with the same name as the parent if it does not start with:
if ( ! function_exists( 'function_name' ) ) :
After the two functions.php files are loaded WordPress will then action the ‘after_setup_theme’ functions, adding and removing.
There clear as mud?
Check out my tutorial series on child themes and template parts!
Download this sample theme for my second tutorial set, this has some of the example code I have used here in the functions.php
HTH
David