[resolved] Turning the header into a link to a page (8 posts)

  1. lally1989
    Posted 2 years ago #

    Hi guys, Im having a nightmare putting a link in my header to a particular page, Ive read and searched everywhere, but nothing seems to work.

    Apparently I should be using code along these lines in the header.php:
    <div id="headerimg" onclick="location.href='http://www.thepageiwanttolinkto.com';" style="cursor: pointer;">

    but to no avail.

    The code in the header.php is:

     * The Header for our theme.
     * Displays all of the <head> section and everything up till <div id="main">
     * @package Expound
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <!--[if lt IE 9]>
    <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
    <?php wp_head(); ?>
    <body <?php body_class(); ?>>
    <div id="page" class="hfeed site">
    	<?php do_action( 'before' ); ?>
    	<header id="masthead" class="site-header" role="banner">
    		<div class="site-branding">
    			<div class="site-title-group">
    				<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>
    				<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
    		<nav id="site-navigation" class="navigation-main" role="navigation">
    			<h1 class="menu-toggle"><?php _e( 'Menu', 'expound' ); ?></h1>
    			<div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'expound' ); ?>"><?php _e( 'Skip to content', 'expound' ); ?></a></div>
    			<?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => 3 ) ); ?>
    			<?php do_action( 'expound_navigation_after' ); ?>
    		</nav><!-- #site-navigation -->
    	</header><!-- #masthead -->
    	<div id="main" class="site-main">

    Any help would be greatly appreciated!

  2. Hey. Firstly, any changes you want to make to the header.php should be done via a child theme. Making changes this way will ensure that you don't lose your changes when updating the theme in the future. More information about the importance of child themes and how to create one can be found here: http://codex.wordpress.org/Child_Themes.

    Where exactly do you wish to add the link in your header?

    Do you want to link it to plain text or to an image?

  3. lally1989
    Posted 2 years ago #

    Hey, apologies for the delayed reply!
    I would like to make the whole header image clickable so if a person clicks on any part of the header, it would take them to a particular page, Ive tried just about everything but nothing seems to work!

    Thanks in advance!

  4. Konstantin Kovshenin
    Theme Author

    Posted 2 years ago #

    What's the URL of your site?

  5. Konstantin Kovshenin
    Theme Author

    Posted 2 years ago #

    Closing this as resolved due to inactivity. Feel free to reopen the thread if you're still having trouble with the theme!

  6. bluepartner
    Posted 2 years ago #

    Hello, I have the same problem like lally1989. Could you help me to solve the problem?

    Thanks in advance.

  7. Michael
    Forum Moderator
    Posted 2 years ago #


    it might be better if you start your own topic (as this is marked as resolved and might not attract any attention) and include a link to your site.


  8. bluepartner
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.