• Resolved Sopra27

    (@sopra27)


    Hello,

    I’m trying to re-add my custom thumbnails size in my functions.php (in child theme) but my usual code stopped worked (not displayed in media uploader like before) since the update (with regen. thumb and new uploaded img):

    function alx_setup() {
    // Enable featured image

    add_theme_support( ‘post-thumbnails’ );

    // Thumbnail sizes
    if ( function_exists( ‘add_image_size’ ) ) {
    add_image_size( ‘mininews’, 90, 90, true );
    add_image_size( ‘thumb-small’, 160, 160, true );
    add_image_size( ‘thumb-medium’, 520, 245, true );
    add_image_size( ‘thumb-large’, 1000, 472, true );
    }

    add_filter(‘image_size_names_choose’, ‘my_custom_sizes’);
    function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
    ‘mininews’ => __(‘Mini-news’),
    ) );
    }

    What i need to do ?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Sopra27. The alx_setup() function has been renamed and updated. This is the current function in /functions/init-core.php:

    function hu_setup() {
        // Enable title tag
        add_theme_support( 'title-tag' );
    
        // Enable automatic feed links
        add_theme_support( 'automatic-feed-links' );
    
        // Enable featured image
        add_theme_support( 'post-thumbnails' );
    
        // Enable post format support
        add_theme_support( 'post-formats', array( 'audio', 'aside', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) );
    
        // Declare WooCommerce support
        add_theme_support( 'woocommerce' );
    
        // Thumbnail sizes
        add_image_size( 'thumb-small', 160, 160, true );
        add_image_size( 'thumb-standard', 320, 320, true );
        add_image_size( 'thumb-medium', 520, 245, true );
        add_image_size( 'thumb-large', 720, 340, true );
    
        // Custom menu areas
        register_nav_menus( array(
          'topbar' => 'Topbar',
          'header' => 'Header',
          'footer' => 'Footer',
        ) );
    }
    Thread Starter Sopra27

    (@sopra27)

    Hello,

    The problem was just to change alx_setup to hu_setup

    Thanks !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add custom image size in child theme’ is closed to new replies.