![]() | | ||||||||
| | #1 |
| Warrior Member War Room Member Join Date: Aug 2007 Location: Yelm, WA, USA.
Posts: 27
Thanks: 14
Thanked 3 Times in 3 Posts
|
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 |
| | |
| | |
| | #2 |
| Advanced Warrior War Room Member Join Date: May 2004 Location: Perth, Australia.
Posts: 717
Thanks: 4
Thanked 182 Times in 138 Posts
|
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 |
| ----------------- Get Your Backlinks indexed quicker at BackLinks2RSS Create Full Text Feeds from Partial RSS Feeds at FeedExpander.com. See the WarriorForum post about it here Last edited by Bruce Hearder; 09-29-2009 at 03:43 AM. Reason: trying to get php code to display properly | |
| | |
| | #3 |
| Active Warrior War Room Member Join Date: Sep 2009 Location: Corvallis, OR
Posts: 34
Thanks: 7
Thanked 1 Time in 1 Post
|
I was actually just looking for the same thing in Wordpress and stumbled across this. Thanks guys!
|
| | |
![]() |
|
| Tags |
| php, requested, wordpress |
| Thread Tools | |
| |
![]() |