WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Custom page "label" (like All-In-One-SEO) (8 posts)

  1. Strategerizer
    Member
    Posted 3 years ago #

    First of all, Yoast's plugin is great, really like the comprehensiveness.

    I am encountering a missing feature that is pretty big in my situation. I am using a widget in the sidebar which automatically provides links to sub-pages. The visible text for these links is the page "label" which by default is the value I enter for the PAGE TITLE.

    So, when I write a page, the PAGE TITLE I create there will be used for:
    - The H1 for the page (this probably controlled by the theme)
    - The <title> tag (controlled by Yoast's plugin, can be set to a different value)
    - The sidebar navigation links (controlled by Nice Navigation plugin)

    Problem is, for SEO purposes I want my page title to be longer, rich in keywords. But for purpose of sidebar navigation links, I need to have them short and sweet - 1 or 2 words.

    All-In-One-SEO had a great field I could set for "page label". Then the Nice Navigation plugin would show that label field, rather than the longer page title. This is missing in WordPress SEO.

    Any ideas or workarounds on how I may be able to keep the H1 on the page long and rich but have a short version to display for the page "label"?

    Thanks!

  2. Strategerizer
    Member
    Posted 3 years ago #

    UPDATE: Further digging reveals that All-In-One-SEO was providing Page Label functionality using code from the Page Menu Editor plugin. So would it be possible to have that code incorporated into the WordPress SEO plugin?

    For now I will use that plugin separately:
    http://wordpress.org/extend/plugins/page-menu-editor/
    http://www.stuffbysarah.net/wordpress-plugins/page-menu-editor/

  3. plymouthdesign
    Member
    Posted 3 years ago #

    Create a custom field called PageLabel in your pages to be used by widget

  4. Strategerizer
    Member
    Posted 3 years ago #

    Plymouthdesign,

    I tried following the suggestion:

    - Went to the Edit Page back-end
    - Went to Custom Fields section
    - Created a new custom field called PageLabel and gave it a value

    However, the label appearing in my Nice Navigation in the sidebar did not change... Here is the page:
    http://komotion.com/learn/planning/gallery/

    I also tried creating a field page_label with same result.

    Did I miss something? Maybe I need to also tweak the widget PHP code to ensure it is using that specific variable. Does WordPress officially have a variable called "PageLabel"?

    It is interesting though that when I used the All-In-One-SEO to change the label, that did indeed change the page name appearing in the Nice Navigation widget...

  5. plymouthdesign
    Member
    Posted 3 years ago #

    Yes, your widget would have no knowledge of this new custom field. See the WP Custom Fields documentation and scroll down to the functions section. You would have to modify your widget to use the get_post_meta function - this can grab the custom field value.

    Meta functions work within The Loop so your widget would have to be a custom function which gathers the sub-pages and corresponding custom field data.

  6. Sarah Anderson
    Member
    Posted 3 years ago #

    Strategizer, have you looked into using the new WordPress custom menus? They will allow you to have complete control of your menus (including custom links in between WordPress pages, custom anchor text, custom title attributes etc.)

    To be honest, they make my plugin (Page Menu Editor) a bit redundant, however it will continue to be supported as and when I get the time to :)

  7. Strategerizer
    Member
    Posted 3 years ago #

    Sarah, I use NiceNavigation plugin to provide a great expand/collapse "explorer" type navigation in the sidebar. I don't think this is something that WP Custom Menus are able to do, right?

    For SEO purposes page names should be long. But since the sidebar provides a tight space, I need to provide short custom labels.

    Using your plugin I am able to provide a short custom page label whihc the NiceNavigation plugin picks up and uses for the sidebar widget. I am not sure how the two "talk" but I must assume you both use some sort of standard WP field like "PageMenuLabel" (or maybe you both use a non-standard name whihc coincidentally is the same).

    Do you think I would be able to give a value to that field ("PageLabelMenu"?) using the WP custom menu functionality? How would I do that?

  8. Sarah Anderson
    Member
    Posted 3 years ago #

    If the NiceNavigation plugin picks up the menu labels and title attributes from my plugin then it must be using wp_list_pages() in some format (wp_page_menu() uses wp_list_pages() too). So by the sounds of it the plugin merely adds the CSS (and possibly adds some additional classes to the menu for it) to create the expand/collapse navigation, which to be honest with the right CSS shouldn't require a plugin anyway.

    You could also do this with the custom menus if you know the right code. Unfortunately my CSS is limited and it's not something I could tell you how to set up without a lot of testing and work. Perhaps ask the NiceNavigation plugin creator if they can get their plugin to work with the WP custom menus too?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic