Howdy developer!
The following is a quick and easy way to add a link in your tagline in the Customizr theme.
We are going to use the ‘tc_tagline_display’ filter to do so. (check how to locate a filter in Customizr)
Copy and paste the following code in the functions.php file of your child theme :
add_filter( 'tc_tagline_display' , 'my_link_in_tagline'); function my_link_in_tagline() { global $wp_current_filter; ?> <?php if ( !in_array( '__navbar' , $wp_current_filter ) ) :?> <div class="container outside"> <h2 class="site-description"> <?php bloginfo( 'description' ); ?> <a href="[PUT YOUR URL HERE]" title="[A TITLE]">My link</a> </h2> </div> <?php else : //when hooked on __navbar ?> <h2 class="span7 inside site-description"> <?php bloginfo( 'description' ); ?> <a href="[PUT YOUR URL HERE]" title="[A TITLE]">My link</a> </h2> <?php endif; ?> <?php }
Note : in this filter, I use the global $wp_current_filter to determine in which filtering context we are because the function is used in two different action hook : responsive or not. Another way to check the current filter in WordPress is to use the current_filter() function, but this one will only show the current hook and not the nested hooks (meaning hooks included in other hooks).
27 thoughts on “Adding a link in the WordPress tagline”
Hi Nicolas,
On the one hand, thank you very much for this page, it has been very helpful!
On the other hand, I’m new in wordpress and really have no idea about coding so you can imagine I screwed-up my whole website. Today, I was feeling brave enough to modify the code for the first time, so I followed your instructions and everything went well the first time until I made a huge mistake the second time: I thought that copying and pasting your code twice I could add two links in my tagline…
Well, that ended up terribly bad: Fatal error: Cannot redeclare my_link_in_tagline() (previously declared in /home/lionball/public_html/wp-content/themes/customizr/functions.php:63) in /home/lionball/public_html/wp-content/themes/customizr/functions.php on line 104
Now my website doesn’t work at all and I cannot even access to my dashboard… Any ideas how can I undo that or at least delete that second copy of the code that I added? I’m really sorry for asking this, but I just found myself in this big mess and don´t know how to fix it…
Thank you very much for reading!!
Hi,
The developer team handles support for Customizr at https://wordpress.org/support/theme/customizr and for Customizr-Pro at http://presscustomizr.com/support/. Please post your query there with a link to your site.
That’s alright, thank you! 😉
Giorgio et Nicolas, I had the same issue of double-taglines (Customizr-3.4.16), and realized I had to delete the existing tagline text I had previously entered via the [Customize] > Global Settings > Site Title & Tagline > Tagline field.
hi,
I want to completely remove the header link with no effect when mouse over my logo…
Could you help me please ?
Thank you for this wonderful theme.
Regards
fly
Hi!
our developer team tries to handle technical requests for the Customizr free theme in the support forum, would you mind asking your question there ?
https://wordpress.org/support/theme/customizr
Thanks 🙂
sir good artical very useful
I noticed two features on this site that I would like to add to my site.
!, Call to action button in header
2. Banner with Call to Action
How do I add these
Hi Joe,
Those features are currently being tested and will be added to Customizr Pro in the coming days.
Thanks for your feedback 🙂
Hello Nicolas,
thanks for the great job you did with this theme and his support.
I use it on 3 sites and I’m thinking to buy customizr Pro.
I’d like to know if you added the 2 features above (call to action and banner in header) in the Pro version.
I can’t see it in the features or the change log.
I also like to hnow il there’ll be a version with Bootstrap 3 like you said few months ago.
If yes, will it be a brand new theme or just included in customizr ?
Thanks
Isa
Hi Isa, thanks for your message 🙂
– those 2 features are not added in the pro version
– Bootstrap3 is currently being added in the dev version. The theme will stay as it is, it will just be upgraded to bootstrap3, with the possibility to revert back at any time to the previous version of course.
Cheers,
Nicolas.
Dear Nicolas & Team,
Customizr is by far one of the most user friendly themes even for newbies like me, Thank you!
This is the second website, I am building using this amazing theme.
Kindly note that I was trying to edit the footer credits and the following error message now stops me from even going back to the editor option. I am able to go back to the Dashboard but not the editor.
“Parse error: syntax error, unexpected ‘d’ (T_STRING) in /home/content/p3pnexwpnas04_data03/84/2358884/html/wp-content/themes/customizr-child/functions.php on line 17”
Please advise.
Thanks,
Ganesh
Hi Ganesh,
Thanks for the good words :).
This look like a common php error. Please visit those links and see if it helps :
http://codex.wordpress.org/Common_WordPress_Errors
http://www.hongkiat.com/blog/common-wordpress-errors-with-solutions/
If you are new to Customizr customization, you’ll also want to visit this page.
I hope this will help you.
Thanks
Is it possible to make that link a mailto: link so it opens an email client?
Hi Doug, sure it’s possible, just use mailto:[email] in the href attribute of the a tag in this snippet.
More about mailto and email links, and a html tag.
Hope this will help!
When I am adding the code I am seeing this error when I click update?
Parse error: syntax error, unexpected ‘link’ (T_STRING) in /home/ddoine0618/public_html/wp-content/themes/customizr/functions.php on line 56
This is what I am trying to add into the functions.php file:
Hi Doug, this is a very common error in php.
You might want to read this : http://codex.wordpress.org/User:Skippy/Common_PHP_Errors
your response to Doug is not very helpful for noobs 🙁
I pasted your code at the top into a php validator and got the following results:
PHP Syntax Check: Parse error: syntax error, unexpected ‘}’ in your code on line 21
I tried the page you referenced in your answer to Doug, but cannot figure out what is wrong.
More clarification please?
Hi Ja,
I just re-tested the code snippet and it work fine.
You might want to read this guide on how to customize the Customizr theme.
http://www.presscustomizr.com/customizr/how-to-customize-customizr-wordpress-theme/
Cheers
Hey Nicholas, my snippet won’t work, please update my first post with this code:
add_filter( ‘tc_tagline_display’ , ‘my_link_in_tagline’);
function my_link_in_tagline() {
global $wp_current_filter;
?>
Bebo-Lachmann.de1
Bebo-Lachmann.de2
<?php
}
Hi Giorgio, thanks for sharing this trick.
Really interesting hover effects!
Sorry, this is the full snippet:
Hi Nicholas,
I tried to use your snippet with Customizr 3.1.19 and I had a glitch on the page.
Basically the tagline was showing twice, so I found this workaround to avoid the problem: I commented out the php call for bloginfo
It turned out to be a very nice advantage if you have a very long tagline description on desktop, you can now reduce it and make it shorter just for tablets or even shorter for mobile.
Here is where I used it: Bebo-Lachmann
The code doesn’t work for me. There is a bug i copy paste this in my childstyle of functions.php 🙁
Sorry finally that’s good. It was again a problem with my using of /*
Is it possible to add a line-break in the tagline?
Hi good question!
This is actually not possible from the customizer option screen as it will be “escaped”. You’ll have to use a filter (like the one above) and add the
tag where you need to.