WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I make Header title text link to home page (9 posts)

  1. ubiquitoushastings
    Member
    Posted 2 years ago #

    I'm working with a 2011 child and am trying to make the header title text "Hastings Ubiquitous" linkable back to the homepage. You can find my site at http://www.ubiquitoushastings.com

  2. Andrew
    Forum Moderator
    Posted 2 years ago #

    I assume this header title text is in the header.php file (as repeated on all pages).
    If so, find where this title is being created & surround a hyperlink around the text (linking to the home page).

  3. ubiquitoushastings
    Member
    Posted 2 years ago #

    I'm guessing this is the code. where would I instert the link tag?

    <body <?php body_class(); ?>>
    <div id="page" class="hfeed">
    <header id="branding" role="banner">
    <hgroup>
    <h1 id="site-title"><?php bloginfo( 'name' ); ?></h1>
    <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
    </hgroup>

  4. Andrew
    Forum Moderator
    Posted 2 years ago #

    Around the <h1> text
    Something like this

    <h1 id="site-title">
      <a href="/" title="<?php bloginfo( 'name' ); ?>">
       <?php bloginfo( 'name' ); ?>
      </a>
    </h1>
  5. ubiquitoushastings
    Member
    Posted 1 year ago #

    I was able to get it work but my site-title dissapeared and the link worked for my site-description instead.

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

    Make sure you have ending speech marks or apostrophes

  7. ubiquitoushastings
    Member
    Posted 1 year ago #

    I'm not exactly sure what you mean. php is very foreign to me still

  8. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    I'm working with a 2011 child and am trying to make the header title text "Hastings Ubiquitous" linkable back to the homepage.

    what you describe is the default bahaviour -

    this is the original code:

    <hgroup>
    				<h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
    				<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
    			</hgroup>

    so you want to re-create something which you have destroyed before?

  9. ubiquitoushastings
    Member
    Posted 1 year ago #

    yes exactly. I must have messed with the code earlier before this post. thanks for the help

Topic Closed

This topic has been closed to new replies.

About this Topic