• The new header layout in latest version of Sydney currently doesn’t have font size option for menu item.

    In the process of my searching, I found the following php snippet that you provided sometime ago in one of the threads.

    (Reference thread: https://wordpress.org/support/topic/menu-item-text-size-disappeared/)

    I used the Code Snippets plugin to paste the PHP snippet

    It controls not only the font size of the menu text it also controls the size of the footer text.

    Is there some way you can modify the snippet so that it will ignore everything except the menu text?

    link to footer image: https://snipboard.io/AkEtRv.jpg

    Here is the php code snippet

    —–>font size option for menu item<————-

    <?php
    add_action(‘wp_enqueue_scripts’, ‘sydney_child_menu_font_size’, 9999);
    function sydney_child_menu_font_size() {

    $custom_css = ”;
    $menu_size = get_theme_mod( ‘menu_size’, ’18’ );
    if ($menu_size) {
    $custom_css .= “#mainnav ul li a { font-size:” . intval($menu_size) . “px; }”.”\n”;
    }

    wp_add_inline_style( ‘sydney-style’, $custom_css );

    }
    ?>

    ====================================================================

    Thank you for all of you help.

    Joshua Davis

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi Joshua,

    Try this CSS code:

    add_action('wp_enqueue_scripts', 'sydney_child_menu_font_size', 9999);
    function sydney_child_menu_font_size() {
    	
    	$custom_css = '';
    	$menu_size = get_theme_mod( 'menu_size', '18' );
    	if ($menu_size) {
    		$custom_css .= ".header-col #mainnav ul li a { font-size:" . intval($menu_size) . "px; }"."\n";
    	} 
    	
    	wp_add_inline_style( 'sydney-style', $custom_css );
    	
    }
Viewing 1 replies (of 1 total)
  • The topic ‘PHP Snippet For Font Size Option For Menu Item’ is closed to new replies.