I'm using wordpress on my site and for some reason the wp_list_pages() isn't showing a title attribute?
I'd love to add it for the SEO purposes.
Any help?
My current code is
wp_list_pages('depth=1&title_li=&exclude=9');
I'm using wordpress on my site and for some reason the wp_list_pages() isn't showing a title attribute?
I'd love to add it for the SEO purposes.
Any help?
My current code is
wp_list_pages('depth=1&title_li=&exclude=9');
Here is an example from the Wordpress codex.
In the following example, only Pages with IDs 9, 5, and 23 are included in the list and the heading text has been changed to the word "Poetry", with a heading style of :
wp_list_pages()
not supposed to have a title attribute by default. You can always write your own functions if the given functions don't fit your needs.Place this in your themes function.php and use it instead of
wp_list_pages()
. If you are using a standard wordpress theme I recommend creating a child theme for this, since theme updates will remove your changes in the future. Feel free to add any ids and classes as you need them. It gets a little more complicated when you add css classes likecurrent_page_item
for the currently visible page to the generated HTML markup.'post_title.'">%s%s%s',