• Resolved universalwares

    (@universalwares)


    Hi,

    I’ve put the below recommended code from this woothemes doc in my child theme’s functions.php and it isn’t changing the text from “Primary Menu”.

    add_filter( 'storefront_menu_toggle_text', 'jk_storefront_menu_toggle_text', 10 );
    function jk_storefront_menu_toggle_text( $text ) {
    	$text = __( 'Navigation' );
    	return $text;
    }

    My functions.php isn’t erroring and my version of the storefront theme is up to date so it does include the ‘storefront_menu_toggle_text’ filter. I feel like I’m missing something obvious but it just isn’t working. Any ideas?

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi, did you put this in a child theme and activate the child theme?

    There is a bug in this theme’s file – storefront/inc/structure/header.php

    Line 51:

    <button class="menu-toggle"><?php apply_filters( 'storefront_menu_toggle_text', $content = _e( 'Primary Menu', 'storefront' ) ); ?></button>

    The _e() function echos the text “Primary Menu” and there is no echo/print for the apply_filters() function.

    So change this line to:

    <button class="menu-toggle"><?php echo apply_filters( 'storefront_menu_toggle_text', __( 'Primary Menu', 'storefront' ) ); ?></button>

    Hopefully WooThemes will fix it in their next release.

    True, I’ll fix this in the next update.

    FYI, please open issues on github for bug reports.

    Thread Starter universalwares

    (@universalwares)

    Thanks your your help. I’ll keep the function in my child theme’s functions.php and keep an eye out for the next theme update.

    FYI, please open issues on github for bug reports.

    Done – https://github.com/woothemes/storefront/pull/128

    This is fixed in version 1.3.0 ??

    yes, it works now with documentation code

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Rename "Primary menu" in mobile view’ is closed to new replies.