Changing Site Logo URL Through Child Theme
-
I’m newish to WordPress, brand-new at child themes, and don’t know PHP at all, so I hope I’m even asking the right questions here!
Using my child theme for the Oxygen Theme, I want to change the site logo’s url so it points to an external website. Before I was working in a child theme, I was able to achieve this by directly editing the functions.php file (I know, I know… not supposed to do that!); here’s the code:
‘function oxygen_site_title() {
$tag = ( is_front_page() ) ? ‘h1’ : ‘div’;
if ( get_header_image() ) {
echo ‘<‘ . $tag . ‘ id=”site-title”>’ . “\n”;
echo ‘‘ . “\n”;
echo ‘<img class=”logo” src=”‘ . get_header_image() . ‘” alt=”‘ . get_bloginfo( ‘name’ ) . ‘” />’ . “\n”;
echo ‘‘ . “\n”;
echo ‘</’ . $tag . ‘>’ . “\n”;’When I replaced “get_home_url” with the URL I wanted, it worked fine. However, when I try to put this in my Child Theme in a functions.php file with the URL changed, it doesn’t work.
Any suggestions would be greatly appreciated! Thanks in advance for any help!
The topic ‘Changing Site Logo URL Through Child Theme’ is closed to new replies.
