Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi Angela,

    Unfortunately, there’s no easy way to create a link out of the header image as a whole. You would have to create a child theme, create a new header.php file, duplicate the code from the header.php file in Hemingway, change the header section to a link and remove the link for the blog title (since a link can’t be placed within another link).

    – Anders

    Thread Starter angelatjuh

    (@angelatjuh)

    Hi Anders,

    Thanks for your reply. I’m already working with a child theme, so I understood it to ‘duplicate the code from the header.php file in Hemingway’. (i paste this code in the child theme header.php)

    But this code in header.php seems different than other header files I’ve seen so far.
    Where in this can i change the header section to a link?

    > >
    ' title=' — ' rel='home'> ?' alt=''>
    
    	?	'', 'items_wrap' => '%3$s', 'theme_location' => 'primary', 'walker' => new hemingway_nav_walker ) ); } else { wp_list_pages( array( 'container' => '', 'title_li' => '' )); } ?>
    
    	?	'', 'items_wrap' => '%3$s', 'theme_location' => 'primary', 'walker' => new hemingway_nav_walker ) ); } else { wp_list_pages( array( 'container' => '', 'title_li' => '' )); } ?>

    Angela

    Theme Author Anders Norén

    (@anlino)

    Hi Angela,

    That code is part of the navigation – it’s telling WordPress to use a function (or really a navigation walker) in functions.php to display the menu. You won’t need to edit that to change the header to a link, though, since it’s a separate section from the header section.

    To change the header to a link, wrap the element .header-cover in a link element and remove the link inside the element .blog-title (but leave <?php echo esc_attr( get_bloginfo( 'title' ) ); ?> as it is). That should do it.

    – Anders

    Thread Starter angelatjuh

    (@angelatjuh)

    Hi Anders,

    Ok, this must feel like a stupid question.. but I’ve got absolutely no idea where I can find the two elements you’re talking about or where to make the change.
    Not sure which php or css to check or where to put it. Sorry!

    Maybe it’s possible to explain it a bit more simple? ??

    Angela

    Theme Author Anders Norén

    (@anlino)

    Hi Angela,

    Absolutely! I’ll make it easy: Create a file called header.php in the child theme, and copy and paste the code I’ve posted here: https://codeshare.io/ZL2dB Save the file. Provided I’ve understood you correctly, the header should work as you want it to.

    Let me know how it goes.

    – Anders

    Thread Starter angelatjuh

    (@angelatjuh)

    Hi Anders,

    Thank you so much for your patience and help!
    This works perfectly!

    Kind regards,

    Angela

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Link header image to homepage’ is closed to new replies.