[resolved] snippet to replace the tagline display in navigation bar (9 posts)

  1. enclick
    Posted 2 years ago #

    I would like to replace the tagline in the default customizr navigation bar (tc_tagline_display), with buttons. Just like on the themesandco.com website

    Is there a snippet for the buttons_on_navbar() filter function:

    add_filter('tc_navbar_display', 'buttons_on_navbar')

    I cant seem to find the snippet used in themesandco.com

    Umm, can I find the a themesandco.com child theme anywhere?

  2. rdellconsulting
    Posted 2 years ago #

    @nikeo wrote this Snippet which might help?

  3. enclick
    Posted 2 years ago #

    Almost, but the tagline div is not part of the "> Appearance > Menu > " panel

    "tc_tagline_display" element has to be adapted with a filter function I guess

  4. rdellconsulting
    Posted 2 years ago #

    I'm slowly trying to learn php with the help of @acub. I'm sure he would push you into a filter solution.

    If you do it, then would welcome you publishing here so I can add it to the growing list of Snippets. You're not the first to request this.

  5. enclick
    Posted 2 years ago #

    I have written a filter, but it is not a robust way of replacing the tag line. There are several div and hearder elements used, and the regular expression becomes ugly and patchy quickly.

    The most elegant and robust method is remove the original function "tc_tagline_display", and replace with a custom one which inserts content manually.

    Can you check with Nicolas how he did it?

  6. acub
    Posted 2 years ago #

    @enclick, leave the tagline untouched and put a display:none on it. You want it properly displayed by your website name in search engine results, don't you?
    Just output the replacement html after it, by filtering. Tweeter Bootstrap buttons are here.

  7. enclick
    Posted 2 years ago #

    The tc_tagline filter replaces the content of the <h2> elements.

    You will note there are two <h2> elements, and the tagline is output in two different formats. No idea why the template needs duplicate output, so I left them as they are

    Simpler to replace the content of the two <h2>

    Tagline in the title and the header is obviously left as it is

  8. acub
    Posted 2 years ago #

    The two taglines are needed because depending on width of the screen, the tagline is displayed inside or outside the navbar. Narrow your browser window down and you'll see what I mean.

    You only need one of them in the page's html, so search engines can find it and use it. Also, having two is no big deal, the search engine stops looking for tagline after it has found it.

    So, is your problem solved?

  9. enclick
    Posted 2 years ago #

    yes, I replaced both <h2> blocks so my buttons show inside and outside the navbar, same as tagline

    Great link to the bootstrap graphic resources - better than jqueryui


Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic