• Hey Crew,

    look at this:

    add_theme_support( 'post-thumbnails' );
    if ( function_exists( 'add_theme_support' ) ) {
      add_theme_support( 'post-thumbnails' );
    }
    
    if ( function_exists( 'add_image_size' ) ) { 
      add_image_size( 'imageone', 361, 170, array('center', 'center') );
      add_image_size( 'imagetwo', 257, 171, array('center', 'center') );
    
     }

    It works fine, awesome. But:

    add_theme_support( 'post-thumbnails' );
    if ( function_exists( 'add_theme_support' ) ) {
      add_theme_support( 'post-thumbnails' );
    }
    
    if ( function_exists( 'add_image_size' ) ) { 
      add_image_size( 'imageone', 361, 170, array('center', 'center') );
      add_image_size( 'imagetwo', 257, 171, array('center', 'center') );
      add_image_size( 'kingsize', 1150, 540, array('center', 'center') );
    
     }

    works not. Why is WordPress hidung the kingsize? Its not working. When i set the kingsize to 30, 540 it starts to work. But when i set it back to 1150,540 it stopped.

    Excuse me… ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    Your media size Should be big greater than your kingsize at Admin > Settings > Media.

    Hello,

    This appears to be our premium theme, KingSize WordPress.

    For buyer support, we would encourage you visit our forums:

    https://owmlabs.ticksy.com

    There we would be more than happy to assist you with your questions and use.

    Kind regards,
    Bryce Wisekal
    https://www.ourwebmedia.com

    Thread Starter wedes

    (@wedes)

    Hey @mdshak
    thanks for your answer. I changed the large size in “Media Settings” to 2048 x 2048px and tried it again. But my KingSize option still doesnt works. I also changed the medium size… nothing happens.

    Some other ideas? ??

    Moderator bcworkz

    (@bcworkz)

    mdshak was on the right track, but identified the wrong source of the size restriction. Many themes limit the maximum image size you can specify with the $content_width global. This value is used in image_constrain_size_for_editor() to restrict what sizes are available for use in the theme.

    As a global value, it is easily altered as needed. For example, it can be changed depending on what template is being loaded. To override the theme’s value in all cases, do something like:
    add_action( 'after_setup_theme', function(){ $GLOBALS['content_width'] = 2048; }, 100 );

    This can be done from a plugin or child theme. It may be beneficial to check where and how your theme initially sets this, there may be a more proper way to override. For example, the twentysixteen theme allows you to set the initial value with the ‘twentysixteen_content_width’ filter. Thus it is not an override, but a filtered initial value. A minor distinction for sure, but it is slightly more efficient and “cleaner” done this way.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘add_image_size plays with me’ is closed to new replies.