• Hello.

    I’m trying to set a custom image size on my child theme, but it doesn’t work.
    I’m using the TwentyEleven theme, and the code I’m using on functions.php is:

    <?php
    function twenty_eleven_child_add_image_size() {
        add_image_size( 'juliana', 770 );
    }
    add_action( 'after_setup_theme', 'twenty_eleven_child_add_image_size', 11 );
    ?>

    I’m forgetting something?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • In what way doesn’t this work? Where – and how – are you using the new image size in your child theme’s template files?

    Thread Starter ellp

    (@ellp)

    I am trying to add a new image size to select on media section to insert the image. I need a 770px wide image to cover all the width (100%) of the content section.

    I am trying to add a new image size to select on media section to insert the image.

    See “Using the New Image Sizes” in https://codex.www.ads-software.com/Function_Reference/add_image_size

    Thread Starter ellp

    (@ellp)

    Hello again esmi.

    I found this code on wp-mayor:

    if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'new-size', 300 );
    }
    
    add_filter('image_size_names_choose', 'my_image_sizes');
    function my_image_sizes($sizes) {
    $addsizes = array(
    "new-size" => __( "New Size")
    );
    $newsizes = array_merge($sizes, $addsizes);
    return $newsizes;
    }

    And not works neither… Any idea?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add Image Size on Child theme doesn't work’ is closed to new replies.