WordPress.org

Ready to get started?Download WordPress

Forums

Change pagetitle into image Hatch theme (10 posts)

  1. allroundecreator
    Member
    Posted 1 year ago #

    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?

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    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.

  3. allroundecreator
    Member
    Posted 1 year ago #

    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?

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Exampled image

    <img class="logo" src="/wp-content/themes/yourThemeName/images/yourImage.png" alt="Explanation of Logo" />
  5. allroundecreator
    Member
    Posted 1 year ago #

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

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

    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.

  7. allroundecreator
    Member
    Posted 1 year ago #

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

  8. Andrew
    Forum Moderator
    Posted 1 year ago #

    It kept giving the title.

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

  9. allroundecreator
    Member
    Posted 1 year ago #

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

  10. cb austin
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic