WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. lally1989
    Member
    Posted 10 months 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:

    <?php
    /**
     * 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(); ?>>
    <head>
    <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>
    <![endif]-->
    
    <?php wp_head(); ?>
    </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>
    			</div>
    		</div>
    
    		<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. Siobhan Bamber (siobhyb)
    Forum Mod.
    Posted 10 months ago #

    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
    Member
    Posted 10 months 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
    Member
    Theme Author

    Posted 10 months ago #

    What's the URL of your site?

  5. Konstantin Kovshenin
    Member
    Theme Author

    Posted 9 months 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
    Member
    Posted 9 months ago #

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

    Thanks in advance.

  7. alchymyth
    Forum Moderator
    Posted 9 months ago #

    @bluepartner

    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.

    http://wordpress.org/support/theme/expound#postform

  8. bluepartner
    Member
    Posted 9 months ago #

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.