Hi,
you can use a slightly different version of this
add_filter( 'tc_tagline_display' , 'my_link_in_tagline');
function my_link_in_tagline( $html ) {
global $wp_current_filter;
?>
<?php if ( !in_array( '__navbar' , $wp_current_filter ) ) :?>
<div class="container outside">
<h2 class="site-description">
<a href="[PUT YOUR URL HERE]" title="[A TITLE]">My link</a>
</h2>
</div>
<?php else:
return $html; //when hooked on __navbar;
endif;
}
hope this helps.
Hi d4z_c0nf, thanks for replying!
I tried the code you provided but a link doesn’t appear in my sticky header tagline. Could you check my code below and see if I did something wrong. Should I remove these >> [ ] in the link?
/* This code changes the tagline */
add_filter( 'tc_tagline_display' , 'my_link_in_tagline');
function my_link_in_tagline( $html ) {
global $wp_current_filter;
?>
<?php if ( !in_array( '__navbar' , $wp_current_filter ) ) :?>
<div class="container outside">
<h2 class="site-description">
<a href="[http://www.google.com]" title="[Awesome title]">d4z_c0nf is awesome</a>
</h2>
</div>
<?php else:
return $html; //when hooked on __navbar;
endif;
}
Thanks for helping, d4z! 🙂
Nope, not your fault, it’s my fault!
Don’t know why but I thought about the mobile tagline. Sorry 😉
replace the old wrong code with this (with [] already removed)
add_filter( 'tc_tagline_display' , 'my_link_in_tagline');
function my_link_in_tagline($html) {
global $wp_current_filter;
?>
<?php if ( in_array( '__navbar' , $wp_current_filter ) ) :?>
<h2 class="site-description">
<span class="tagline"><?php bloginfo( 'description' ); ?></span>
<a class="sticky-tagline" href="http://www.google.com" title="Awesome Title">Yes d4z_c0nf is really awesome! :P</a>
</h2>
<?php else :
return $html; //when hooked outside __navbar
endif;
}
Then in your custom-css add this:
.site-description .sticky-tagline {
display: none;
}
.sticky-enabled .site-description .tagline {
display: none;
}
.sticky-enabled .site-description .sticky-tagline {
display: block;
}
d4z_c0nf, you really are awesome!! Thank you very much for this! Is there a way to make this new link open in a new window? Thank you, d4z! 😀
adding target=_blank
<a class="sticky-tagline" target="_blank" href="http://www.google.com" title="Awesome Title">Yes d4z_c0nf is really awesome! :P</a>
You’re welcome.
Thank you very much, d4z!!
Sorry to bump this… is there a way to do this before the update with sticky header options?
EXAMPLE
We have this in CSS:
/* Make Header 'Sticky' */
.tc-header {
position: fixed;
top: 0px;
background-color: #fff;
z-index: 101;
width: 100%;
max-height: 113px;
}
body {
padding-top: 113px;
}
We want the tagline to disappear on scroll.
Do you know a solution?
Thank you
Only sticky menu items.
I tried:
.navbar .nav > li > a { position: fixed; }
but it makes them move…