

- #HOW TO CHANGE HEADER IN WORD WITHOUT CHANGING OTHER PAGES HOW TO#
- #HOW TO CHANGE HEADER IN WORD WITHOUT CHANGING OTHER PAGES ARCHIVE#
- #HOW TO CHANGE HEADER IN WORD WITHOUT CHANGING OTHER PAGES CODE#
* Display an alternate logo in the single post, search, blog, and archive page header. If ( ! function_exists( 'yourtheme_alt_logo' ) ) : I chose this implementation because I’m creating a custom theme for a client.įor those who want to implement it without the direct link, you can assign the image to a variable, especially if you’ve placed the image in a different directory than the uploads. I saved the alternate logo file in a directory beneath the theme, instead of uploading it to the media library. This snippet saved me a lot of headaches. So while the custom logo feature in WordPress is meant to have a consistent branding image throughout all your site pages, you can also modify it to customize the picture based on your needs. You just need to add new “if/else” conditional statements one after the other to cover all the conditions you want. You can continue this process and introduce more and more custom logos for various other conditions. This is a different logo from the one we say displayed earlier on the home page.
#HOW TO CHANGE HEADER IN WORD WITHOUT CHANGING OTHER PAGES CODE#
With the above code in place, my custom logo now changes to the second one whenever an individual post is being displayed.

Use this handy WordPress reference for all the different conditional tags you can use. For example, if you want to display the logo for a particular category, you’ll need to use the “in_category()” function instead of “is_single”. And change the conditional tag to match your own requirements. Replace the URL in bold with the URL of your own secondary custom logo. It replaces the tag of the custom URL with a new image tag and a new URL.It checks to see if the page a “single page” using the function “is_single()”.Open up your functions.php or plugin where you enter custom PHP code and paste in the following:Īdd_filter('get_custom_logo','change_logo_on_single') Now we need to use a different logo for certain pages. You can see in the screenshot below, that my custom logo appears at the top of my homepage: The logo that you set here will be shown on all pages of your WordPress site by default.

If you don’t see the facility for choosing a logo, it means your theme doesn’t support this feature and you’ll need to enable it using the tutorial I linked to in the first paragraph. Now select the tab called “Site Identity” as shown here:Īnd now, set your default logo in the space provided. To do this, go to your WordPress Dashboard and click “Appearance -> Customize” on the left hand side. So you’ll need to set one of them as your site’s primary logo. You need to let WordPress know that you’re using the custom logo feature. In my example, I’m using just two logos and I’ve uploaded them as shown here: First, select all the logos you want to display and upload them to WordPress using the media manager. Step 1: Upload Both your Logos to WordPress
#HOW TO CHANGE HEADER IN WORD WITHOUT CHANGING OTHER PAGES HOW TO#
But in this tutorial, I’m going to show you how to do that without a plugin and with just a small piece of code. By default, WordPress doesn’t allow this kind of modification. Or you’d like one logo for the home page, and another logo for single pages. Perhaps you want a new logo for a certain category. However, there might come a time when you want to modify the logo depending on the page. We’ve written a blog post earlier on how to enable support for custom logos and how to display them with the appropriate sizes.ĭue to the nature of logos, you will most likely want to leave it unchanged for various pages.

Older themes which don’t have support for custom logos, can be easily modified. Ever since version 4.5, WordPress has had the ability for blog owners to set a custom logo for their site that can be displayed on every page depending on the theme. How to Change the Custom Logo Depending on the Page in WordPress Posted on Updated on December 17, 2020Ī logo is part of your site identity.
