Support » Fixing WordPress » Change the URL for logo

  • wotnow

    (@wotnow)


    Hi,

    This is the code for my header.php that I think I have to change to get my logo to link to a different website rather than the home page.

    Would some kind soul show me exactly what line of code to change. New URL is

    <div id="header">
    		<div id="masthead">
    			<div id="branding" role="banner">
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>
    <a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    				<?php

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Christine Rondeau

    (@crondeau)

    Volunteer Forum Moderator

    Something weird happened with the code got pasted in.

    When adding code, make sure you use the code tag to wrap your snippet.

    I think that your header has something like this:

    <a href="<?php bloginfo( 'url'); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>

    You can change that to <?php bloginfo( ‘name’ ); ?>

    wotnow

    (@wotnow)

    Thanks for your response! I am not sure what you mean by the code .. I can read it fine.

    Your answer has really enlightened me at all<a href="<?php bloginfo( 'url'); ?>

    This line of code I do not have.
    I have re-pasted the code in between code tags.

    <div id="header">
    		<div id="masthead">
    			<div id="branding" role="banner">
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>
    <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    				<?php
    Christine Rondeau

    (@crondeau)

    Volunteer Forum Moderator

    Change this sentence:

    <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>

    to:

    <a href="http://yourdomain.com"><?php bloginfo( 'name' ); ?></a>

    wotnow

    (@wotnow)

    Thanks very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change the URL for logo’ is closed to new replies.