Adding a link in the WordPress tagline


Note :This snippet works only with the Classical style option. The Classical style option can be enabled in Appearance > Customize > Advanced > Theme Style. More about the theme style option here


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 :

 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).


Related Snippets you may also like


We can help you to implement this snippet

Coding is our job and we know WordPress inside and out. We can help you to customize your website with small chunks of code snippets like this one.

Send us your request and we'll get back to you quickly.



27 thoughts on “Adding a link in the WordPress tagline

  • Aliax

    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!!

  • Ron Herren

    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.

  • fly

    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

  • Joe

    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

    • Nicolas Post author

      Hi Joe,
      Those features are currently being tested and will be added to Customizr Pro in the coming days.
      Thanks for your feedback 🙂

      • isa

        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

        • Nicolas Post author

          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.

  • Ganesh

    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

      • Doug Doine

        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:

  • Giorgio Riccardi

    Sorry, this is the full snippet:

  • Giorgio Riccardi

    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

    • Nicolas Post author

      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.

Comments are closed.