我试图让我的子主题正常工作,并在主主题函数中覆盖一行代码。php,但我不能去工作,因为我在php方面完全是新手。
在我的主主题函数中。php我有:
add_image_size(\'portfolio-three\', 300, 214, true);
当我直接更改它时,更改图像大小它就像一个魔咒一样工作,并调整我的公文包页面中的图像大小。但我想把它包括在儿童主题中。函数的代码。子主题中的php如下: <?php
function mytheme_child_scripts() {
if ( ! is_admin() && ! in_array( $GLOBALS[\'pagenow\'], array( \'wp-login.php\', \'wp-register.php\' ) ) ) {
$theme_info = wp_get_theme();
wp_enqueue_style( \'mytheme-child-stylesheet\', get_template_directory_uri() . \'/style.css\', array(), $theme_info->get( \'Version\' ) );
}
}
add_action(\'wp_enqueue_scripts\', \'mytheme_child_scripts\');
add_image_size(\'portfolio-three\', 388, 214, true);
?>
而且它不工作,什么也没有发生,没有错误,也没有图像大小调整。我不知道在这里该怎么办。谁能帮助我正确地实施它?顺致敬意,亚切克