![]() |
Wordpress / PHP Help Requested Is there a way to remove the link part of wp_list_pages, leaving only the text apart? < li >< a href=*** >Page Title < /a >< /li > ----> < li >Page Title< / li > I want to created a bulleted list of a level of pages on my site, but I don't want them to be hyperlinked. Is this possible? Do I need to use some kind of regular expression replacement? I've tried a few, but it did not strip out the link. Or is there maybe another function that will give me just the list of titles? Thanks! Lisa |
Re: Wordpress / PHP Help Requested Hi Lisa, I think this code snippet will do what you want (or at least get you on the right path): $pages = wp_list_pages('depth=1&title_li=&echo=0'); if ($pages) { if (preg_match_all('/<a [^>]+>(.*)<\/a>/Uis', $pages, $array)) { $titlesarray = $array[1]; foreach ($titlesarray as $title) echo '<strong>'.$title.'</strong><br>'; } } I hope this helps Bruce |
Re: Wordpress / PHP Help Requested I was actually just looking for the same thing in Wordpress and stumbled across this. Thanks guys! |
| All times are GMT -6. The time now is 09:29 PM. |