I have uploaded a file as my main logo within the theme settings but would like a different logo on the main page. The theme I am using has a custom css option within the theme settings, can I use custom css to only change it on the front page and not the rest of the site?
Leave a Reply
You must be logged in to post a comment.
It looks like the theme designer has a means for you to use a different logo on the homepage. Looking at your
header.php
on lines 83-93.If your theme detects that this is the front page, the title is enclosed with an
<h1>
tag, otherwise it is enclosed in a<div>
. Both haveid='logo'
.If you can add custom css, you could use css image replacement to replace this
<h1>
tag with a different image on your homepage.at header.php you can found this tags:
You just need access the a style-colorchoose.css at line 43 and change image path at class .default-logo, if you inspect using chrome developer tool you can find this class calling a logo from CSS using this class I mentioned.
Know if this theme offer a solution to change logo it’s other way they cannot help you.
Contact me if you need a help.
There are many ways to do this. Let’s go.
1. Just Header File
Open your header.php and find when logo is displaying and add conditional home tag. Something like this:
2. Using CSS Background Image
Open your header.php and go to tag. Add the body_class() function.
Now, you can customize any element on home with CSS. For Example:
You should be able to use vanilla CSS. I wasn’t able to reach your site to give you the exact CSS. But, here’s an example using the Twenty Twenty theme. All the WordPress themes I work with follow this pattern.
Obviously change the page/post ID, logo URL, and logo dimensions to yours.
Here’s how to get the page/post ID.
Shout if you have any questions 🙂