Forums

wp_page_menu includes 'Home" even with show_home=0 (6 posts)

  1. stanof
    Member
    Posted 10 months ago #

    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.

  2. alchymyth
    The Sweeper
    Posted 10 months ago #

    try and use 'show_home=false&.....
    http://codex.wordpress.org/Function_Reference/wp_page_menu
    (untested)

  3. stanof
    Member
    Posted 10 months ago #

    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.

  4. stanof
    Member
    Posted 10 months ago #

    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?

  5. stanof
    Member
    Posted 10 months ago #

    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.

  6. fwootten
    Member
    Posted 9 months ago #

    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.

Reply

You must log in to post.

About this Topic