Making a clickable header
-
I have searched the web and the forums extensively and I cannot figure this out.
I’m aware the theme puts the header in the background. I’m aware that making it a logo instead makes it clickable, but then there’s a massive gap between the logo and the navigation bar, and the image is not full size.
I have made the image clickable before, but I had another unrelated issue and got the WSOD and had to completely uninstall and reinstall WordPress, and this was before I learned the glory of child themes, so I’m starting over. Probably for the best, but I digress.
I’m guessing the reason it was clickable in the previous modified version was because I made the ‘site-branding’ section a link? I just know it was something I did in header.php and I think it was actually adding a href=”” somewhere. Adding ‘onclick’ as I’ve seen in many places, has done nothing for me, and I read for many people that if it did work, it made the entire site clickable.
Any ideas? This is my header.php, I really haven’t done anything to it.
`<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <main id=”main”>
*
* @package Sela
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link rel=”profile” href=”http://gmpg.org/xfn/11″>
<link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>”>
<?php wp_head(); ?>
</head><body <?php body_class(); ?>>
<div id=”page” class=”hfeed site”>
<header id=”masthead” class=”site-header” role=”banner”>
<a class=”skip-link screen-reader-text” href=”#content” title=”<?php esc_attr_e( ‘Skip to content’, ‘sela’ ); ?>”><?php _e( ‘Skip to content’, ‘sela’ ); ?></a><div class=”site-branding”>
<?php sela_the_site_logo(); ?>
<h1 class=”site-title”><a href=”<?php echo esc_url( home_url( ‘/’ ) ); ?>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></a></h1>
<?php if ( ” != get_bloginfo( ‘description’ ) ) : ?>
<h2 class=”site-description”><?php bloginfo( ‘description’ ); ?></h2>
<?php endif; ?>
</div><!– .site-branding –><nav id=”site-navigation” class=”main-navigation” role=”navigation”>
<button class=”menu-toggle” aria-controls=”menu” aria-expanded=”false”><?php _e( ‘Menu’, ‘sela’ ); ?></button>
<?php wp_nav_menu( array( ‘theme_location’ => ‘primary’ ) ); ?>
</nav><!– #site-navigation –>
</header><!– #masthead –><div id=”content” class=”site-content”>`
- The topic ‘Making a clickable header’ is closed to new replies.