Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 12th Jun 2011, 03:52 AM   #1
HyperActive Warrior
War Room Member
 
Jelle Kaldenbach's Avatar
 
Join Date: 2011
Posts: 218
Thanks: 41
Thanked 40 Times in 35 Posts
Default
HELP WANTED - Where to put the anchor?
Share on: 
fb share twitter share gplus share more share

Hi all

I want to put an anchor behind all the links in the menu (all need to have #title behind their permalink). This is the code I found in my theme, it's in a div called top-menu, so I guess this is it . Where should I put the #title thing?

I already have all the anchors on the actual page they link to, so if I put #title after the permalink from the page it should work, right?

Code:
<?php echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><a$2#title><span>$3</span></a>', wp_list_pages('echo=0&orderby=name&title_li=')); ?>
Hope someone can help me!
~Jelle

Jelle Kaldenbach is offline  
Unread 12th Jun 2011, 06:03 AM   #2
WordPress Expert
War Room Member
 
xtrapunch's Avatar
 
Join Date: 2011
Location: New Delhi, India
Posts: 1,097
Thanks: 29
Thanked 172 Times in 131 Posts
Default
Re: HELP WANTED - Where to put the anchor?
Share on: 
fb share twitter share gplus share more share

Read about the WordPress menu function. That is the right way of implementing a menu in a theme. You will have better control along with the ability to have any URL along with whatever anchor you want.

>> Web Design, Wordpress & SEO - XtraPunch.com <<
Web Design & SEO Agency | Serving World Wide from New Delhi, India

xtrapunch is offline  
Unread 12th Jun 2011, 08:46 PM   #3
Hard Hitting Developers
War Room Member
 
ionisis's Avatar
 
Join Date: 2011
Posts: 52
Thanks: 4
Thanked 4 Times in 4 Posts
Default
Re: HELP WANTED - Where to put the anchor?
Share on: 
fb share twitter share gplus share more share

I don't see where that code is GETTING the "Title" from. It's not there, so you can't use it. As far as WHERE to put it, i can't help you there, as we don't work with 3rd party software. But i CAN tell you that you FIRST need to be SUPPLYING the function with the Titles that it's supposed to use.
ionisis is offline  
Closed Thread


Bookmarks

Tags
anchor, put, wanted


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 12:43 AM.