| | #1 |
| HyperActive Warrior War Room Member Join Date: 2011
Posts: 218
Thanks: 41
Thanked 40 Times in 35 Posts
|
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=')); ?> ~Jelle |
| | |
| |
| | #2 |
| WordPress Expert War Room Member Join Date: 2011 Location: New Delhi, India
Posts: 1,097
Thanks: 29
Thanked 172 Times in 131 Posts
|
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 | |
| |
| | #3 |
| Hard Hitting Developers War Room Member Join Date: 2011
Posts: 52
Thanks: 4
Thanked 4 Times in 4 Posts
|
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.
|
| |
|
| Bookmarks |
| Tags |
| anchor, put, wanted |
| |