Forums

wp_list_pages and custom fields (3 posts)

  1. micasuh
    Member
    Posted 2 weeks ago #

    I have a use for wp_list_pages that's a little unconventional.

    For a page, I have a long Title that's optimized for SEO. I want to link to this page on the home.php page, but I want that link to say something different than the optimized title. Why? Because I wanna shorten it.

    Here's an example.

    Page Slug: http://example.com/nurses
    Page Title: Nurses know medicine and will protect your health
    Link on home.php: Nurses and Medicine

    So, in essence, I'd like to call a custom field to display "Nurses and Medicine" on the homepage using the wp_list_pages tag. If I display this page elsewhere using wp_list_pages, it would be the normal "Nurses know medicine and will protect your health" title.

    Is this possible?

    The only other thing I'd be interested to know is if it's possible to link to an exact part of the page, such as http://example.com/nurses#medicine using wp_list_pages.

  2. MichaelH
    moderator
    Posted 2 weeks ago #

    You need to look at Function_Reference/get_pages and Custom Fields.

  3. micasuh
    Member
    Posted 6 days ago #

    I looked at those but don't have a clear idea of how to use those to work for me. Is what I'm describing not possible with using wp_list_pages?

Reply

You must log in to post.

About this Topic