さて、多くの欲求不満の後で、私はこれに対する解決策を見つけました(私は子供テーマが物事をスピードアップすることを意図していると思いました!?)。親テーマが設定されると「after_theme_setup」が実行されるため、これは機能すると思います。つまり、その時点でTwentyElevenの関数を削除/オーバーライドできます。
私が正しく理解していれば、このドキュメントによると、最初に子テーマが実行され、次に親が実行され、次に子テーマのfunctions.phpファイルの「after_theme_setup」コードが実行されます。
http://codex.wordpress.org/Child_Themes#Using_functions.php
と
http://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme
これは私の子テーマのfunctions.phpファイルにあるものです。これが誰かに役立つことを願っています:
// ------------------------------------------------------------------
// // !AFTER_SETUP_THEME
// ------------------------------------------------------------------
/* Set up actions */
add_action( 'after_setup_theme', 'osu_setup' );
if ( ! function_exists( 'osu_setup' ) ):
function osu_setup() {
// OVERRIDE : SIDEBAR GENERATION FUNCTION - NO WIDGETS FOR THIS SITE
remove_action( 'widgets_init', 'twentyeleven_widgets_init' ); /* Deregister sidebar in parent */
// OVERRIDE : EXCERPT READ MORE LINK FUNCTION
function osu_readon_link() {
return '...<a href="'. get_permalink() . '" class="readmore">' . __( 'Read More...', 'clientname' ) . '</a>';
}
// Function to override
function osu_clientname_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
// $output = trim($output);
$output .= osu_readon_link();
}
return $output;
}
remove_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
add_filter( 'get_the_excerpt', 'osu_clientname_custom_excerpt_more' );
remove_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' );
add_filter( 'excerpt_more', 'osu_readon_link' );
// OVERRIDE : EXCERPT LENGTH FUNCTION
function osu_clientname_excerpt_length( $length ) {
return 30;
}
remove_filter( 'excerpt_length', 'twentyeleven_excerpt_length' );
add_filter( 'excerpt_length', 'osu_clientname_excerpt_length' );
}
endif; // osu_setup