WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_pages() trick (5 posts)

  1. tino25
    Member
    Posted 7 years ago #

    Hello

    When I’m using wp_list_pages() of course I get list of pages. But the list is generated from the page titles. So sometimes the links are very long.
    So for example if i have tile "This is my first page" I will have link "This is my first page". I would like to have link "First page". Is it posible?

  2. tino25
    Member
    Posted 7 years ago #

    anyone?

  3. MichaelH
    Member
    Posted 7 years ago #

    Guess it's possible if you specified, in a field like the excerpt, what you wanted instead of "This is my first page", and then modify the Walker_Page class in wp-includes/classes.php to use the excerpt instead of the title.

  4. tino25
    Member
    Posted 7 years ago #

    I don't know I think it should be an extra field to write the title that will be visible on wp_list_pages().
    So wp_list_pages will not be generated based on title but different field.
    I think is important because there are may situations when we have long title and as a link we wont something short or even something totally different.

    Maybe field like Slug Page.

    Is there any way to do this?

  5. tino25
    Member
    Posted 7 years ago #

    What do you think?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags