Reply To: How can I add the code in the span class "site-title-text" second text under it

#22596
Daniel Tara
Keymaster

OK, I have thought this through and reached the conclusion that the only text that’s reasonable to display there is the site description. To make it display you will first need to make some changes to the code.

Ideally this should go in your child theme’s functions.php file:

function enlightenment_child_filter_site_branding_args( $args ) {
    $args['site_description']     = true;
    $args['site_description_tag'] = 'span';
    
    return $args;
}
add_filter( 'enlightenment_site_branding_args', 'enlightenment_child_filter_site_branding_args', 21 );

Mind the priority set to 21, this is important to override a previous filter set by the theme.

After you’ve added that code the description will display out of place as evidenced in this screenshot:

To make it display properly you will have to apply a bit of styling. This should go under Theme Options → Design under the “Custom CSS” field:

.site-description {
    display: none;
}

@media (min-width: 992px) {
    .navbar-header {
        position: relative;
    }
    
    .navbar-large .site-logo {
        float: left;
        margin-right: 6px;
    }
    
    .navbar-large .site-title-text {
        float: left;
        line-height: 1.3;
    }
    
    .navbar-large .site-description {
        display: inline-block;
        position: absolute;
        top: 46px;
        left: 72px;
        font-size: 12px;
    }
}

This should display the description right under the site title:

When scrolling and the navbar is shrinked the site description will be hidden, just like menu item descriptions:

You can edit the site description under Settings → General, the Tagline field.

  • This reply was modified 8 years, 2 months ago by Daniel Tara. Reason: Correction to CSS code to avoid displaying site description on mobile devices