Archived topic
Adding a new Font to my menu
6 replies · Started by sjoerd89 on March 30, 2020
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?
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.
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;
}
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?
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 :)
I think the menu is fine will open a new topic thanks.
Thanks :)