Forums

[resolved] add_image_size bigger than 640x640 doesnt work? (5 posts)

  1. daku-dev
    Member
    Posted 4 months ago #

    Hello, Im trying to register new image sizes, which works fine for sizes smaller than 640x640. But if i try to register a bigger size, it allways shows up with a longer-side of 640px. here my code...

    <?php
    add_image_size('page_width', 554, 9999, false);
    add_image_size('gallery_width', 383, 287, true);
    add_image_size('full_width', 796, 9999, false);
    function custom_daku_image_sizes($sizes) {
            $myimgsizes = array(
                    "page_width" => __( "Page" ),
                    "gallery_width" => __( "Gallery-thumb" ),
                    "full_width" => __( "Full-Width" )
                    );
            $newimgsizes = array_merge($sizes, $myimgsizes);
            return $newimgsizes;
    }
    add_filter('image_size_names_choose', 'custom_daku_image_sizes');
    ?>

    Does anyone know this problem? ore knows how to solve it?
    thx

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Have you checked your theme's CSS in case it is resizing your final images?

  3. daku-dev
    Member
    Posted 4 months ago #

    after double checking, i realised that while uploading the images get resized in the right dimensions. But in the Uploaderwindow it still says "Full-Width (640x359px)" and later on dispaying it on the page, it inserts the image in wrong dimensions. Although it uses the image with the correct messurements.<img class="alignnone size-full_width wp-image-963" title="1_81-1920x1080" src="path/wp-content/uploads/1_81-1920x10801-796x447.jpg" alt="" width="640" height="359">

  4. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Check your theme's functions.php file for something like:

    if ( ! isset( $content_width ) ) $content_width = 6480;

  5. daku-dev
    Member
    Posted 4 months ago #

    Big thanks, that did it!

Reply

You must log in to post.

About this Topic