Site logo

[Support request] Navigation Branding Formatting

Home Forums Support [Support request] Navigation Branding Formatting

Home Forums Support Navigation Branding Formatting

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2422278
    Adam

    Hi,

    Is there a way using css break up the navigation formatting branding into two lines?

    something like: REALWORLD
    INVESTOR.com
    https://realworldinvestor.com/

    #2422682
    David
    Staff
    Customer Support

    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/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.