• I added a ‘Home’ link to my main menu with the ‘show_home=1’ using wp_page_menu() function.

    Then after a week I didn’t want it there, so I changed the code and it looks like this now:
    wp_page_menu('show_home=0&sort_column=menu_order&include=10,12,14,22,2&link_before=<span><span>&link_after=</span></span>');

    Problem is the ‘home’ is still showing up. I have the site running on 3.2.1. version but also in dev environment on about 1-2 versions lower. Issue is at both locations.

    Does anyone have any idea how to ‘reset’ this function? Or how to solve this problem?

    Thank you very much.

Viewing 6 replies - 1 through 6 (of 6 total)
  • try and use 'show_home=false&.....
    https://codex.www.ads-software.com/Function_Reference/wp_page_menu
    (untested)

    Thread Starter stanof

    (@stanof)

    Thanks for suggestion but it did not work.

    I am thinking whether it made some reference in a DB (or somewhere) to have the ‘home’ included and now it is just including it?

    It is a weird behavior, I haven’t seen something like this with WP before. So of course, I am thinking about (looking for) a possible my own coding error but since it is just one call for a function with couple of args I am running out of luck.

    Thread Starter stanof

    (@stanof)

    I just tried the simplest thing and use only:
    wp_page_menu();

    Guess what? The ‘home’ still shows up.

    According to the WP documentation the default setting for this function is is ‘show_home’ => false. So I don’t get at all how it can display the ‘home’ link without me asking for it.

    There is only one thing now – perhaps a corrupt file?

    Thread Starter stanof

    (@stanof)

    I also tried a new ‘post-template.php’ file and still the same problem.

    I would have to conclude that there has been a mistake made perhaps when the the 3.2 upgrade was released, or maybe a version before that. Because I have another website using 3.1 and the ‘show_home’ arg works there switching back and forth.

    The mistake could be in the codes of wp_page_menu() or wp_list_pages() functions.

    Since I am not a PHP wizard I know enough to code my own themes and create sites with databases, so I apologize if that isn’t a fair guess of the issue.

    If you are using the twentyten theme or a variation of it, you will find in the function.php file that a filter has been added to always include the show_home argument = true. You can comment out the filter to remove the “home” link.

    I had the same problem which fwootten has solved for me – thanks. Is there anyway to nullify the function in the child theme rather than comment it out in the parent theme? An upgrade to the parent theme will undo the change.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘wp_page_menu includes 'Home" even with show_home=0’ is closed to new replies.