Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 09-28-2009, 09:45 PM   #1
Warrior Member
War Room Member
 
Lisa Copen's Avatar
 
Join Date: Aug 2007
Location: Yelm, WA, USA.
Posts: 27
Thanks: 14
Thanked 3 Times in 3 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default 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

Lisa M. Copen
Lisa Copen Recommends - Internet Marketing Resources Blog
IM Squidoo Lens
Lisa Copen is offline   Reply With Quote
Old 09-29-2009, 03:40 AM   #2
Advanced Warrior
War Room Member
 
Bruce Hearder's Avatar
 
Join Date: May 2004
Location: Perth, Australia.
Posts: 717
Thanks: 4
Thanked 182 Times in 138 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Bruce Hearder
Default 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

-----------------
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
Bruce Hearder is offline   Reply With Quote
Old 09-30-2009, 04:25 AM   #3
Active Warrior
War Room Member
 
Join Date: Sep 2009
Location: Corvallis, OR
Posts: 34
Thanks: 7
Thanked 1 Time in 1 Post
Social Networking View Member's Myspace Profile  View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to davidmerrick
Default Re: Wordpress / PHP Help Requested

I was actually just looking for the same thing in Wordpress and stumbled across this. Thanks guys!
davidmerrick is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
php, requested, wordpress

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 03:54 AM.