Archived topic
Tagline question - mobile and dynamic
5 replies · Started by Ash on October 5, 2020
1. How do I show the tagline on the mobile header?
2. I want to change the tagline only on certain pages.
I found how to change the logo dynamically but couldn't find a wat to change the tagline.
Hi there,
as you're wanting to have a variable tag lines the simplest way would be to Hook that into the Mobile Header.
1. Create a new Hook Element
2. Add this for your tagline content:
<span class="mobile-tagline">Your tag line</span>
3. Select the generate_inside_mobile_header hook
4. Set your Display Rules
5. Repeat the above for each different tagline and separate display rules.
Then add this CSS to your site:
.mobile-header-navigation .site-logo {
margin-right: 10px !important;
}
.mobile-header-navigation .inside-navigation {
justify-content: initial;
}
.mobile-tagline {
margin-right: auto;
}
Thank you.
About dynamic tagline, I want to change it not only on mobile but desktop as well.
There is no hook to filter it?
You can use this filter:
add_filter( 'option_blogdescription', function( $tagline ) {
if ( is_home() ) {
return 'custom tagline for blog';
}
return $tagline;
} );
Thank you!
You're welcome :)