Archived topic
Navigation Branding Formatting
1 reply · Started by Adam on November 18, 2022
Viewing posts 1–2 of 2
Hi,
Is there a way using css break up the navigation formatting branding into two lines?
something like: REALWORLD
INVESTOR.com
https://realworldinvestor.com/
Hi there,
you can't do it with CSS, unless the 2 words were identical in length.
So you need to adjust the HTML that is output and to do that you need a PHP Snippet like this:
add_filter( 'generate_site_title_output', function( $output ) {
$titleHTML = '<div>REALWORLD</div><div>INVESTOR.com</div>';
return sprintf(
'<%1$s class="main-title" itemprop="headline">
<a href="%2$s">%3$s</a>
</%1$s>',
( is_front_page() && is_home() ) ? 'h1' : 'p',
esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
$titleHTML
);
});
Adding PHP:
https://docs.generatepress.com/article/adding-php/
This archived topic is closed to new replies.