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

child theme automatically adds new page to top menu instead of only custom menu

programmeradmin4浏览0评论

In my child theme I have top navigation and custom navigation (archive menu). When I add new page to archive menu, same page gets added to top nav. In the admin top nav doesn't show new page though,however, in the browser there's new page showing in top nav.

I unchecked 'Automatically add new top-level pages to this menu' in my top nav but it didn't help

  function archive_menu() {
  register_nav_menu('archive_menu',__( 'Archive' ));
}
add_action( 'init', 'archive_menu' );

output in index.php

<?php
  wp_nav_menu(

    array(
        'theme_location'=> 'archive_menu'
          
  )
);?>

Question: Is there a way to stop new page added to top nav and only have new page added to my archive nav.

BACKEND ADMIN

This is how my custom menu looks in the child theme admin

This is how my primary menu looks in the child theme admin

This is primary (top) nav in the browser (red arrow shows 'archive' menu item which gets added automatically even though I didn't add it in the admin).

发布评论

评论列表(0)

  1. 暂无评论