[Resolved] Adding a new Font to my menu

Home Forums Support Adding a new Font to my menu

This topic contains 6 replies, has 3 voices, and was last updated by  Leo 1 month, 4 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1219192

    sjoerd89

    Hi there,

    i want to add a new font to my menubar/navigation. It is a Font that currently is not in wordpress itself called “Barlow”.
    I have seen some topics about this but still can’t seem to figure it out, any tips?

    #1219409

    David Customer Support

    Hi there,

    try adding this PHP snippet:

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'barlow' ] = array( 
    		'name' => 'Barlow',
    		'variants' => array( '400', '500', '700' ),
    		'category' => 'sans'
    	);
    
    	return $fonts;
    }

    https://docs.generatepress.com/article/adding-php/

    You can update array( '400', '500', '700' ) to add the different weights you need.

    #1219475

    sjoerd89

    I added the font to my website and now trying to get my menubar the same as our productpage:
    https://www.zilvertron.com/ is the current one where i want the same navigation style like
    products.zilvertron.com

    I tried some stuff out but can’t seem to figure out what is going wrong:

    .main-navigation li {
        margin-left: 10px;
        border: none!important;
        font-family: Barlow, Array, sans-serif;
        font-size: 16px;
        font-weight: 600;
        line-height: 18px;
    }
    
    .main-navigation a, .menu-toggle {
        font-family: "Barlow", Array, sans-serif;
    	font-size: 16px;
        font-weight: 600;
        line-height: 18px;
    	margin-left: 10px;
    	border: none!important;
    }
    .main-navigation li a {
        font-size: 12px;
        line-height: 20px;
    }
    #1219694

    sjoerd89

    Already got it pretty close with

    .main-navigation li {
        margin-left: 10px;
        /*border: none!important;*/
        font-family: Barlow, Array, sans! important;
        font-size: 16px!important;
        font-weight: 400;
        line-height: 16px!important;
    }
    
    .main-navigation a, .menu-toggle {
        font-family: Barlow, Array, sans! important; 
    	font-size: 16px!important;
        font-weight: 400;
        line-height: 18px;
    	//*margin-left: 10px;*//
    	border: none!important;
    }
    .main-navigation li a {
        font-size: 16px;
        line-height: 20px;
    }

    Probably not the nice way how it should be done.

    Also is it possible to get a image in the navigation bar aswell like on products.zilvertron.com with the shopcart?

    #1219797

    Leo Customer Support

    Is the menu all good now? If not we would need to see the page in question.

    Any chance you can open a new topic for the new question?

    Thanks 🙂

    #1220362

    sjoerd89

    I think the menu is fine will open a new topic thanks.

    #1221058

    Leo Customer Support
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.