Support » Fixing WordPress » Remove menu from blog page (posts page)

  • Resolved budlix


    last days I am confused from trying remove menu list of pages ( from my posts page.

    I’m using BlankSlate theme and for menus I added function for MenuName, so I can have different menu on each page where MenuName is (custom field).

    Everything works fine except posts page, where is still showing list of pages I have created in wp.

    It looks like the posts page is “computed” different than other pages, so it ignores MenuName or what..

    Here is my posts page test: (my static page named blog have MenuName custom field, same as here, where it works fine:

    Here is page with menu called with MenuName through custom field.

    Please note: Main menu is hard-coded, what I’m solving is secondary menu which is different on each page or is not showing.

    Thank you very much for any response!

Viewing 1 replies (of 1 total)

    This was my process:

    File: header.php
    Original Code Line: <?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>
    Revised Code Line: <?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’, ‘menu’ => get_post_meta( $post->ID, ‘MenuName’, true) ) );?>
    Also: “Then create a new custom field called MenuName and give it a value matching the name of the menu you want that page to use.”

    Solved – just moved code from header.php into page.php

Viewing 1 replies (of 1 total)
  • The topic ‘Remove menu from blog page (posts page)’ is closed to new replies.