WordPress.org

Ready to get started?Download WordPress

Forums

headerimg gets cropped despite right size (8 posts)

  1. aeon365
    Member
    Posted 5 years ago #

    I changed the headerimg px in the CSS to
    #headerimage {
    clear: both;
    background: transparent url(img/header.jpg) no-repeat 0 0 center;
    margin: 10px;
    height: 75px;
    width: 830px;

    When I upload a pic 830x75 it still gets cropped and the header is totally messed up. Plus sometimes there is a black background instead of transparent.

    This is the blog:
    http://www.gruender-foerdermittel.de/

    Thanks a lot for you help

  2. nglavin
    Member
    Posted 5 years ago #

    you sure thats the right image ?? when i click view background image the image does not look as thought it has been saved correctly ??? very grainy as well i would suggest you try and resave the image and try again also set a larger height for the image

  3. aeon365
    Member
    Posted 5 years ago #

    The image shown is "after-cropping"
    I upload a 830x75 and WP forces me to crop.
    If I choose an area to crop the image gets resized and i end up with this grainy image (a resized part of my original picutre)
    OR i try not to crop and the image is not there at all - instead i have a black background (see right now).

  4. aeon365
    Member
    Posted 5 years ago #

    I also tried to upload the picture via ftp:
    i defined the headerimg to be found as: /img/header.jpg
    if i upload a 830x75 named header.jpg it does not appear on the blog (black background - instead of transparent as defined).

    i feel i miss out on some fundamental thing i have to adjust?

  5. nglavin
    Member
    Posted 5 years ago #

    what file are you editing index.php or header.php ?? my site uses tim thumb to resize images <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php bloginfo( 'template_directory' ); ?>/timthumb.php?src=<?php echo get_post_meta( $post->ID, "image_value", true ); ?>&w=600&h=250&zc=1" alt="<?php the_title(); ?>" /></a> ?>&w=600&h=250&zc=1" this line of code automatically crops re-sizes images to 600 x 250 is there code like that on the div that you are placing the image into bit i know its a bit of a stab in the dark without seeing the code but if the image is getting re sized automatically i would have to think there would be a java call some where that does it rather than the css

  6. aeon365
    Member
    Posted 5 years ago #

    header.php:
    <div id="headerimage">
    </div>

    nothing like that in the index.php.

    I found something at the end of functions.php

    I am not really familiar w php but it looks like this resizes my image in some way?

    <?php

    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '%s/img/misty.jpg'); // %s is theme dir uri
    define('HEADER_IMAGE_WIDTH', 760);
    define('HEADER_IMAGE_HEIGHT', 200)
    ;
    define( 'NO_HEADER_TEXT', true );

    function mistylook_admin_header_style() {
    ?>
    <style type="text/css">
    #headimg {
    background: url(<?php header_image() ?>) no-repeat;
    }
    #headimg {
    height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    }

    #headimg h1, #headimg #desc {
    display: none;
    }
    </style>
    <?php
    }
    function mistylook_header_style() {
    ?>
    <style type="text/css">
    #headerimage {
    background: url(<?php header_image() ?>) no-repeat;
    }
    </style>
    <?php
    }
    if ( function_exists('add_custom_image_header') ) {
    add_custom_image_header('mistylook_header_style', 'mistylook_admin_header_style');
    }
    load_theme_textdomain('ml');
    ?>

  7. nglavin
    Member
    Posted 5 years ago #

    yeah i would change the

    define('HEADER_IMAGE_WIDTH', 760);
    define('HEADER_IMAGE_HEIGHT', 200);

    to

    define('HEADER_IMAGE_WIDTH', 830);
    define('HEADER_IMAGE_HEIGHT', 75);

    sorry bout that last post comment box is bugged in FF couldn't do returns ???

    also is that CSS inline ?? in the php file ??

    i could also suggest CUTTING ! lol that out saving and then testing the site again inline code overwrites code in the css file

    make sure you cut it out so you can paste it back in if anything happens
    lol

    #headimg {
    height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    } that is telling it to resize the head image to 760 x 200 so hope this helps

  8. aeon365
    Member
    Posted 5 years ago #

    Cutting out doesnt work - wont show any header at all (just white/transparent background)

    Changed the px to 830x75 and it works fine! I will change the 830 to fit the rest of the layout but at least it works :-)

    Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic