Can anyone translate this code? (2 posts)

  1. keress
    Posted 5 years ago #

    I've inherited a site from someone else and am trying to figure out why the navbar is not linking anywhere. There's this code in the template:

    <?php echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><a$2><span>$3</span></a>', wp_list_pages('echo=0&orderby=name&exlude=181&title_li=&depth=1?')); ?>

    If you look at the page source for this page:


    The links are there, but they're dead on the site.

    Weird. Anybody have any idea what's going on?

  2. kymac
    Posted 5 years ago #

    It looks like it is taking a string like:
    <li part1><a href="part2">part3</a>
    and changing it to:
    <li part1><a href="part2"><span>part3</span></a>
    I don't see what purpose the span tags serve.

    You might try taking out the preg_replace to see what you get without it. Compare that to the results with it and you may get a better idea of what is going on.

    <?php echo wp_list_pages('echo=0&orderby=name&exlude=181&title_li=&depth=1?'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.