Link Logo?
-
Can you link the Logo to another website and have it open in the same window?
-
You can’t do this through the theme. You’d have to code it, I guess.
Any idea on how to do that or does that have to be done by the Theme Creator?
You don’t need the theme creator to do it; you can do it yourself. I guess by editing the php for the header, but I don’t know how.
However, why do you want to do this? It’s now pretty much a de facto standard that clicking a logo takes you to the home page of a site. If you change this behaviour it may annoy your users or, worse, make them think that there is something suspicious going on.
I agree 100% but it’s what my client wants so, LoL. I started with the Header PHP, but I was playing with the code and the site went blank once so I’m just trying to see if I can find exactly what I’m looking for before messing something up.
Try this:
Move class-main-header.php into your child theme so:customizr
…customizr-child
–parts (create with New Folder)
class-main-header.phpLine 125 (before):
<h1><a class="site-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name' , 'display' ) ); ?> | <?php bloginfo( 'description' ); ?>"><img src="<?php echo $logo_src ?>" alt="<?php _e( 'Back Home' , 'customizr' ); ?>" <?php echo $logo_img_style ?>/></a>Line 125 (after)
<h1><a class="site-logo" href="http://mysite.com" target="_blank" title="<?php echo esc_attr( get_bloginfo( 'name' , 'display' ) ); ?> | <?php bloginfo( 'description' ); ?>"><img src="<?php echo $logo_src ?>" alt="<?php _e( 'Back Home' , 'customizr' ); ?>" <?php echo $logo_img_style ?>/></a>(Think is very close to what you need!)
Line 125 (before):
<h1><a class="site-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name' , 'display' ) ); ?> | <?php bloginfo( 'description' ); ?>"><img src="<?php echo $logo_src ?>" alt="<?php _e( 'Back Home' , 'customizr' ); ?>" <?php echo $logo_img_style ?>/></a>Line 125 (after)
<h1><a class="site-logo" href="http://mysite.com" target="_blank" title="<?php echo esc_attr( get_bloginfo( 'name' , 'display' ) ); ?> | <?php bloginfo( 'description' ); ?>"><img src="<?php echo $logo_src ?>" alt="<?php _e( 'Back Home' , 'customizr' ); ?>" <?php echo $logo_img_style ?>/></a>Sorry, my backticks have gone awry!
Remove
target="_blank"to avoid a new Page.(Sorry all my backticks went awry)
Can I test the code via the Child Them Editor on site or do I have to create a new file within the PHP?
And which ones are supposed to be the backticks?
Oh, do the backticks just make the code pop-up in that little window?
Sorry, the backticks is this Forum and puts shade around code so forget about that.
Sounds like you need to look at Child Themes first so read this:
https://managewp.com/how-to-create-a-child-themeYou’re going to take a copy of the customizr file, and then edit the copy so you don’t spoil the original file. You store it in the Child Theme directory customizr-child/parts.
Have a go, I’ll be here again tomorrow.
YOU FOUND THE RIGHTY LINE! ALL THAT NEEDS TO CHANGE IS THE:
href=”http://mysite.com” target=”_blank” title=”<?
TO
href=”http://www.mysite.com” title=”etc. etc.THANKS AGAIN!
The topic ‘Link Logo?’ is closed to new replies.
