最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Noob question: want to remove the "site identity" logo for specific part of website only

programmeradmin1浏览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.

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.

Share Improve this question asked Jun 6, 2019 at 11:10 ClubShrimpClubShrimp 12 bronze badges 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 Commented Jun 6, 2019 at 12:20
Add a comment  | 

1 Answer 1

Reset to default 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.

发布评论

评论列表(0)

  1. 暂无评论