WordPress.org

Forums

Tonic
Replace site title with logo (6 posts)

  1. ajpiano
    Member
    Posted 1 year ago #

    There was a post a month ago about this but no proper reply - anyone got ideas about this?
    I simply want to have an image/logo instead of the text in the site title - it needs to be clickable of course...

  2. Jesin A
    Member
    Posted 1 year ago #

    You have to edit the header.php file to do this. For these changes to persist even after updating the theme create a Child Theme first. Activate it and copy wp-content/themes/tonic/header.php to wp-content/themes/tonic-child/header.php

    Edit this copied header.php file go to line 45 and hard code your image

    <a href="<?php echo esc_url( home_url() ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="mylogo.png" alt="<?php bloginfo( 'name' ); ?>" /></a>

  3. bravokeyl
    Member
    Posted 1 year ago #

    It comes from header.php line 45

    <h1 id="site-title"><a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>

    You need to create a child theme for this

    if parent theme supports
    .
    and change the code to

    <h1 id="site-title"><a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php  echo get_stylesheet_directory_uri().'YOUR IMAGE PATH' ; ?>" alt="<?php bloginfo( 'name' );?> "></a></h1>

    here get_stylesheet_directory_uri() gets the current theme directory.

  4. ajpiano
    Member
    Posted 1 year ago #

    Thanks! You guys are awesome! :-)

  5. geekosupremo
    Member
    Posted 1 year ago #

    I've tried bravokeyl and Jesin A 's soulutions and neither of them is accomplishing what I'm trying to do, which is just turn to whole banner image into a clickable link back to the home page. What am I missing?

    Line 45 of my header.php looks like this
    <a href="<?php echo esc_url( home_url() ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="path" alt="<?php bloginfo( 'name' ); ?>" /></a>

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    @geekosupremo: If you require assistance then, as per the Forum Welcome, please post your own topic.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.