HELP WANTED - Where to put the anchor?

2 replies
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
#anchor #put #wanted
  • Profile picture of the author xtrapunch
    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.
    Signature
    >> Web Design, Wordpress & SEO - XtraPunch.com <<
    Web Design & SEO Agency | Serving World Wide from New Delhi, India

    {{ DiscussionBoard.errors[4054457].message }}
  • Profile picture of the author ionisis
    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.
    {{ DiscussionBoard.errors[4057634].message }}

Trending Topics