WordPress.org

Forums

[WP_LIST_PAGES] No Title on the ahref (2 posts)

  1. rickleijtencom
    Member
    Posted 2 years ago #

    Hey All,

    I've been having a problem, since when i use wp_list_pages, i dont get any title on the ahref (wich is bad SEO). I can only find solutions about people that have titles, but wan't to remove them.. But for some reason i just dont get them?

    Here is the code i use:

    $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&sort_column=menu_order&depth=1");
    					$titlenamer = get_the_title($post->post_parent);

    Could anyone tell me if its my code or if its something i must edit in the wordpress core files?

    Kind regards,

    Rick

  2. bcworkz
    Member
    Posted 2 years ago #

    You can hook the filter 'wp_list_pages'. Your filter function will be passed the output html and an array of arguments used by wp_list_pages(). Your filter function could search and replace as needed in the html, then return the modified html.

    Since wp_list_pages() is passed an array argument, you should be able to add your own argument to the array which your filter function can use to fill in the title attribute, if need be.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.