• Hi there,
    I’m using the hatch theme for my website. I want to change the page title for an image (logo), but I can’t figure out how to do this.
    I found this code in the functions.php, but havn’t got a clue what to change?

    function hatch_site_title() {
    
    	if ( hybrid_get_setting( 'hatch_logo_url' ) ) {	
    
    		$tag = ( is_front_page() ) ? 'h1' : 'div';	
    
    		echo '<' . $tag . ' id="site-title">' . "\n";
    			echo '<a href="' . get_home_url() . '" title="' . get_bloginfo( 'name' ) . '" rel="Home">' . "\n";
    				echo '<img class="logo" src="' . esc_url( hybrid_get_setting( 'hatch_logo_url' ) ) . '" alt="' . get_bloginfo( 'name' ) . '" />' . "\n";
    			echo '</a>' . "\n";
    		echo '</' . $tag . '>' . "\n";
    
    	} else {
    
    		hybrid_site_title();

    Does anyone know?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I don’t think you should be changing that theme’s function.
    Try copying & pasting that function and give it another name.

    Then replace this

    <img class="logo" src="' . esc_url( hybrid_get_setting( 'hatch_logo_url' ) ) . '" alt="' . get_bloginfo( 'name' ) . '" />

    With the static img element that you want.

    You’ll need to also find where that function was originally being called, then change the name to your custom function.

    Thread Starter allroundecreator

    (@allroundecreator)

    Thank you for your reply.
    I tried to do what you’ve said. But it doesn’t seem to work out.
    I probably made a mistake in the code.

    Can you maybe show me how to chage it to a static image?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Exampled image

    <img class="logo" src="/wp-content/themes/yourThemeName/images/yourImage.png" alt="Explanation of Logo" />

    Thread Starter allroundecreator

    (@allroundecreator)

    I have tried as you told, but nothing changes…
    I’ll keep trying anyway.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Did you do this bit

    You’ll need to also find where that function was originally being called, then change the name to your custom function.

    Thread Starter allroundecreator

    (@allroundecreator)

    yes, i changed the name of the function in the header part aswell.
    Nothing happened.
    It kept giving the title.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It kept giving the title.

    The title within the image element? If so, your image path is wrong.

    Thread Starter allroundecreator

    (@allroundecreator)

    Gave it an other try today, changed the image path. Nothing changed…
    Can’t find the solution.
    Probably my limited understanding of php.

    In Dashboard go to Appearance and under Theme Settings there is an option to upload your Logo in place of a title.
    Hope that helps!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Change pagetitle into image Hatch theme’ is closed to new replies.