0

I'm using the Astra theme.

Header.php

Index.php

I'm a total noob. The website is for a town hall that has a small IT centre built onto it, and the IT centre has a logo while the hall itself does not. I'm trying to figure out how to have the logo appear at the top of the page for the IT centre part of the site, but omit it for the town hall part of the site. It seems the only way to do this is to mess with php and css. I think there's some sort of premium Astra add-on that enables you to do this, and so it's possible that the underlying code is designed in such a way as to prevent you from making these kinds of customisations without paying. However, I'm a noob and I can't really tell if this is the case.

Sorry if I haven't provided enough information. I'm sure you won't hesitate to let me know if I have.

1
  • I'd guess the <?php astra_header(); ?> function call emits the logo. That'll be something theme-specific I'm afraid. Can you find that function in the theme? Does it emit the logo itself, possibly just a call to the_custom_logo()? It may also include another template_part that includes the logo. – Rup Jun 6 '19 at 12:20
0

You can achieve this using filter provided in Astra:

add_filter( 'astra_has_custom_logo', '__return_false' );

The above filter disables logo on the website. You will have to add this filter in your child theme's functions.php file inside if conditions of pages where you want to hide the logo.

3
  • Sounds good. I'll have to try this. Thanks! – ClubShrimp Jun 7 '19 at 17:17
  • Hi there, I'm having a bit of trouble getting this to work. The filter does work if I place it outside of an if statement, but it affects the whole website. In an if statement, it doesn't seem to have any effect. I've tried a few conditions (is_page, is_single, is_singular) using the page id number as an argument, but I'm not having any luck. How exactly would you go about doing this? – ClubShrimp Jun 13 '19 at 11:41
  • Okay, nevermind, I figured it out. Here's the code I used for any future noobs like myself: function change_logo_on_community() { if(is_page(377)){ return false; } else{ return true; } } add_filter( 'astra_has_custom_logo', 'change_logo_on_community' ); – ClubShrimp Jun 17 '19 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.