WordPress의 Aaron 자식 테마 기능에 문제가 있습니다. 내 문제의 일부는 자식 function.php WordPress의 부모 기능 덮어 쓰기 에서 답변 했지만 로고를 더 큰 크기로 작동시킬 수 없었습니다. 범위를 좁히고 문제를 찾기 위해 많은 코드를 제거했습니다. 그리고 내가 찾은 것은 자식 테마의 기능이 WordPress에 표시되지 않는다는 것입니다. 이것은 기능입니다 :
/* Site Logo */
function add_site_icon_support() {
$args = array(
'header-text' => array(
'Site Title Here',
'Your site description goes here.',
),
'size' => 'medium',
);
add_theme_support( 'site-logo', $args );
}
add_action( 'after_setup_theme', 'add_site_icon_support' );
부모 테마의 functions.php에 추가하여 테스트했으며 작동합니다. 따라서 어떻게하면 자식 테마에서 작동하는지 궁금합니다.
부모 테마의이 기능과 관련이 있습니까?
function aaron_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on aaron, use a find and replace
* to change 'aaron' to the name of your theme in all the template files
*/
load_theme_textdomain('aaron', get_template_directory() . '/languages');
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
add_theme_support('woocommerce');
add_theme_support('jetpack-responsive-videos');
add_editor_style();
add_theme_support('post-thumbnails');
add_image_size('aaron-featured-posts-thumb', 360, 300);
add_theme_support('title-tag');
register_nav_menus(array(
'header' => __('Primary Menu', 'aaron'),
'social' => __('Social Menu', 'aaron'),
));
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
}
endif; // aaron_setup
add_action('after_setup_theme', 'aaron_setup');
둘 다 동일한 후크를 가지고 있기 때문에.
부모 테마보다 나중에 후크를 실행해야합니다. 기억해야 할 것은 자식 테마가 먼저로드 된 다음 부모 테마가로드된다는 것입니다.
함수가 작동하게하려면 더 낮은 우선 순위가 필요합니다. 당신은 시도 할 수 있습니다
add_action( 'after_setup_theme', 'add_site_icon_support', 11 );
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다