最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Two Homes In Navigation Menu

programmeradmin2浏览0评论

I have the following listed in my navigation menu:

  • Home
  • Contact
  • Home

When I go to the Pages => All Pages, I see

  • Home
  • Contact

Yet, when I go to the Appearances => Menus => Pages => View All I see:

  • Home
  • Contact
  • Home

I've looked for how I can remove the redundant Home navigation option in this Appearances menu, but I don't see that option. Also, there is no second home page from the pages. So how can I remove this from the navigation, or prevent this from appearing twice?

What I've tried

  • I tried removing the home page completely and it did remove one of the homes from the navigation, but I had no way to edit the home page then.
  • In looking through the customization, I haven't been able to discover a way to control which pages appear in the navigation menu - for an example, if I wanted to have a test page that I was working on, it would appear even if I didn't want it. I've looked all over the Appearance => Customize option.

I have the following listed in my navigation menu:

  • Home
  • Contact
  • Home

When I go to the Pages => All Pages, I see

  • Home
  • Contact

Yet, when I go to the Appearances => Menus => Pages => View All I see:

  • Home
  • Contact
  • Home

I've looked for how I can remove the redundant Home navigation option in this Appearances menu, but I don't see that option. Also, there is no second home page from the pages. So how can I remove this from the navigation, or prevent this from appearing twice?

What I've tried

  • I tried removing the home page completely and it did remove one of the homes from the navigation, but I had no way to edit the home page then.
  • In looking through the customization, I haven't been able to discover a way to control which pages appear in the navigation menu - for an example, if I wanted to have a test page that I was working on, it would appear even if I didn't want it. I've looked all over the Appearance => Customize option.
Share Improve this question asked Aug 7, 2016 at 12:16 wpquestionzwpquestionz 1012 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

This sounds like the same problem I had, Wordpress added a home option to the menu without it being added in the appearance menu items so I could not remove it. I googled for ages and found two solutions. Neither of them worked but if I combined the two they did. Open the functions.php file in your site files. If you are using a common theme there might be a function already in there that states something like $args['show_home'] = true; if that is the case then just change the true to false and save the file.

If you are using your own theme or the current theme does not add home to menus by default then just copy the below code, paste it in functions.php, change the yourTheme to the name of your theme and save

function yourTheme_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'yourTheme_page_menu_args' );

  • First you need to click on My Site in the top left corner.

  • Then click on menus (Found under "Personalize")

  • From there you should see a list of the items that are displayed in your navigation bar. Delete any duplicates and you should be good to go.

My noobish 2 cents

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论