Support » Plugin: Page Menu Editor » Get the 'Page Menu Label' for use in my theme

  • Resolved videogold

    (@videogoldhotmailcom)


    Hi,
    I would like to be use the ‘Page Menu Label’ as the title for the page when listed on the search page.

    Is there a variable name or function I can use to grab the ‘Page Menu Label’ for a given page inside the loop?

    I am hoping it’s just basic page meta data I can get, just the same as getting any other page meta data.

    Thanks!

    https://wordpress.org/plugins/page-menu-editor/

Viewing 1 replies (of 1 total)
  • Plugin Author Sarah Anderson

    (@sarahg111)

    Apologies for the late reply, newborn twins ‘n all that!

    The code you want should be something like the below

    @$pgmenueditor = get_post_meta($post->ID, 'dsa_pagemenueditor');
    if (!empty($pgmenueditor[0]) && count($pgmenueditor[0])) :
      $menu_label = stripslashes($pgmenueditor[0]['menu_label']);
    endif;

    and then just use $menu_label where ever you want. You may need to vary the $post->ID to the correct code depending on how your loop is written.

Viewing 1 replies (of 1 total)
  • The topic ‘Get the 'Page Menu Label' for use in my theme’ is closed to new replies.