• If I create a page it is automatically added to my menu.

    global $user_ID;
      $page['post_type']    = 'page';
      $page['post_content'] = $content;
      $page['post_parent']  = 0;
      $page['post_author']  = $user_ID;
      $page['post_status']  = 'publish';
      $page['post_title']   = $title;
      $pageid = wp_insert_post ($page);

    If I change ‘post_status’ to ‘private’, then it doesn’t appear in the menu, but can’t be read either. It also has the word “PRIVATE” added to the title.

    I see there is an option to define custom status, but I’m unsure how to use it or whether it will help.

    I want to create a page that isn’t added to the menu, on which I can place my shortcode to call a function to render a page.

    Calling the page from the menu isn’t going to work because it needs additional parameters.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Most likely you have not created your menus, the default menus index everything.
    So from Dashboard > Appearance > Menus, will list various NAMES and LOCATIONS of menus, this is theme dependent. Choose your menu location, create a menu for it, add the pages, categories, links etc. Remember to SAVE MENU when you are done.

    Thread Starter dgcov

    (@dgcov)

    Hi Ross, cheers.

    This is for a plugin I’m developing.

    The user might not have registered his menus either.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Newly created page appears in menu’ is closed to new replies.