1

I'm using the built in menu system, and I wan't to change the text of the home menu link to something else, like "hjem", and i have tried placing this in the code:

<?php wp_page_menu( array( 'show_home' => 'Hjem', 'sort_column' => 'menu_order' ) ); ?>

But that did nothing but show the menu, with the home menu text "Home".

What do I do?

0

Funnily enough, I see the same behavior in WordPress 3.4.2 and 3.5-beta2. No plugins active, theme TwentyEleven.

Even setting show_home as false will show the Home button ?!

Checking the core, I see this filter that does the trick:

add_filter( 'wp_page_menu_args', 'wpse_70551_change_page_menu');

function wpse_70551_change_page_menu($args) {
    $args['show_home'] = "Hjem";
    return $args;
}

[Update]
This was a bug with the Bundled Themes.

The culprit is twentyeleven_page_menu_args() (twentytwelve_page_menu_args() in Twenty Twelve).

It ignores any passed value and enforces true instead: http://core.trac.wordpress.org/browser/tags/3.4.2/wp-content/themes/twentyeleven/functions.php#L372

22331.patch​ is a fix for all three themes.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.