WordPress.org

Ready to get started?Download WordPress

Forums

Path
[resolved] Full width and responsive header image (6 posts)

  1. gombroo
    Member
    Posted 1 year ago #

    Hello,

    I'd like to change dimensions of my header image and transform it into 100% width like here: http://demo.magpress.com/

    My site: http://www.artdekorprojekt.com/

    Any ideas?
    Thanks in advance!

  2. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    You could copy header.php to child theme and move this code outside #header.

    <?php if ( get_header_image() ) { /* if header image is set use it as logo. */ ?>
    
    <h1 id="site-title"><a href="<?php echo home_url(); ?>" title="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>"><img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" /></a></h1>
    
    <?php } else { ?>
    
    <h1 id="site-title"><a href="<?php echo home_url(); ?>" title="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
    
    <?php }  ?>

    You need some css styling after that.

  3. gombroo
    Member
    Posted 1 year ago #

    Thanks a lot! It works! :)

    I set [#site-title img] width to 100%. Now the header image remains a little bit stretched. What should be the optimal image length in pixels to avoid stretching and loosing sharpness? 1920px?

  4. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    Yep something like that.

  5. joed86
    Member
    Posted 12 months ago #

    Hi, is there a way to use a standard 900 wide header on Path theme?

    What do you mean when you say child theme?

    And do I delete the header template and just add that snippet up there to function.php?

    Thanks, just a little confused and trying to understand your instructions.

  6. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 12 months ago #

    Open new topic for new questions.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic