skip to Main Content

How do I change homepage link (/) to an external link to another site in this code?

<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="site-title site-logo-text" <?php echo esc_attr( $header_text_color ); ?>><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>

3

Answers


  1. <a href="YOUR_OTHER_LINK_HERE" rel="home" class="site-title site-logo-text" <?php echo esc_attr( $header_text_color ); ?>><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
    
    Login or Signup to reply.
  2. If you have fixed url for the external link, you don’t have to put it inside

    Just put it inside the href attribute like so and that should do it

    Login or Signup to reply.
  3. If you want that link to point to another (external) resource, then make it simple, remove the unnecessary PHP code and put the URI in the href attribute. As I put HTTPS://EXAMPLE.COM/ below.

    <a href="HTTPS://EXAMPLE.COM/" rel="home" class="site-title site-logo-text" <?php echo esc_attr( $header_text_color ); ?>><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search