WordPress игнорирует избранные изображения

Я создал тему WordPress на основе классической двадцатки. Я изменил размер изображений заголовка в functions.php, но кроме этого я не стал возиться с пользовательскими материалами заголовка. Теперь WordPress игнорирует его, когда я назначаю избранные изображения страницам, и вместо этого отображает только фон, выбранный в настройках заголовка. Размер изображения не имеет ничего общего с проблемой. Я пытался использовать точный размер изображения и больших изображений, они всегда игнорируются...

Спасибо, если вы можете помочь!

PS. Вот ссылка на сайт: http://stuck-mueller.de/beta/

вот код из functions.php:

// The custom header business starts here.

$custom_header_support = array(
    // The default image to use.
    // The %s is a placeholder for the theme template directory URI.
    'default-image' => '%s/images/headers/path.jpg',
    // The height and width of our custom header.
    'width' => apply_filters( 'twentyten_header_image_width', 960 ),
    'height' => apply_filters( 'twentyten_header_image_height', 240 ),
    // Support flexible heights.
    'flex-height' => true,
    // Don't support text inside the header image.
    'header-text' => false,
    // Callback for styling the header preview in the admin.
    'admin-head-callback' => 'twentyten_admin_header_style',
);

add_theme_support( 'custom-header', $custom_header_support );

if ( ! function_exists( 'get_custom_header' ) ) {
    // This is all for compatibility with versions of WordPress prior to 3.4.
    define( 'HEADER_TEXTCOLOR', '' );
    define( 'NO_HEADER_TEXT', true );
    define( 'HEADER_IMAGE', $custom_header_support['default-image'] );
    define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
    define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
    add_custom_image_header( '', $custom_header_support['admin-head-callback']   );
    add_custom_background();
}

// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be 940 pixels wide by 198 pixels tall.
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );

1 ответ

Вам не нужно apply_filters(), просто присвойте ширину и высоту целым числам вроде:

'width' => 960,
'height' => 240,

Проверьте кодекс здесь для получения дополнительной информации

Другие вопросы по тегам