Tagged: header, logo, transparency
-
AuthorPosts
-
March 18, 2020 at 2:58 pm #1194126
Hi,
I have a transparant logo and set the transparency logo in the settings. I was wondering if I could check, using the avf_logo filter, if a transparent logo is shown or not. Since transparent logo is only used when the screen size is big enough (otherwise it will use the normal logo, see Enfold 2017 Demo) I basically need 4 different logo’s:
1. Language A > transparent logo
2. Language A > normal logo
3. Language B > transparent translated logo
4. Language B > normal translated logoI already know how to check for the language used, so don’t worry about that. I only need to know how to check if a transparent logo is used or not.
ThanksMarch 20, 2020 at 12:19 am #1194633there is another filter that can do the job:
add_filter('avf_header_setting_filter','replace_transparent_logo_on_some_pages'); function replace_transparent_logo_on_some_pages($header){ if( is_page(123) ){ $header['header_replacement_logo'] = "https://url-to-the-new-logo"; } return $header; }
you can use any conditional tag wordpress offers – maybe you can use even
if (lang == 'en') {
you can use arrays :if( is_page( array( 42, 54, 6 ) ) ) {
etc. ppthe logo itself is possible with this as you said allready:
add_filter('avf_logo','av_change_logo'); function av_change_logo($logo){ if( is_page(21) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage21.jpg"; } elseif ( is_page( array( 42, 54, 6 ) ) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage42.jpg"; } elseif ( is_page() && !is_page(1307) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage23.jpg"; } return $logo; }
March 20, 2020 at 10:36 am #1194752Hi,
This is not what I am after.
I am aware of the is_page() function, but I wanted to know if there is somekind of function, like:if ( is_transparent_header() ) : return $logo; endif;
Greetings
March 20, 2020 at 2:47 pm #1194798But this is only relevant if you allow transparency for narrow screen widths.
This would certainly have been an important information in your introduction.On helper-main-menu.php since line 127 ( Enfold 4.7.3)
there is a condition that is bound to header_transparencyon functions-enfold.php since line 1166 :
//header class that tells us to use the alternate logo
the class : av_alternate_logo_active is set for that to #headeron layout.css there is ruled the visibility of that logo:
@media only screen and (max-width: 989px) { .responsive.html_mobile_menu_tablet #top .av_header_transparency.av_alternate_logo_active .logo a > img{opacity:1} .responsive.html_mobile_menu_tablet #top .av_header_transparency .logo img.alternate{display:none;} } @media only screen and (max-width: 767px) { .responsive #top .av_header_transparency.av_alternate_logo_active .logo a > img{opacity:1} .responsive #top .av_header_transparency .logo img.alternate{display:none;} }
March 20, 2020 at 3:08 pm #1194801Hi, I don’t see why this is only relevant for narrow transparent screen widths.
Anyway thanks, I’ll see if I can use the class mentioned.March 20, 2020 at 3:11 pm #1194802the logo if set is alway present : rule it via media querries as in layout.css
________Hi, I don’t see why this is only relevant for narrow transparent screen widths.
if you are below 768px (or 990px) you will generally not see the alternative logo. So why switch. For this case it would be sufficient to set only the normal logos.
So it is only relevant if you keep the transparency contrary to the default settings of Enfold.
In this case, it would be necessary to set a different alternative logo and then make the layout adjustments. -
AuthorPosts
- You must be logged in to reply to this topic.