The MU forums have moved to

Using Function.php to do this with Navigation link??? (4 posts)

  1. kennibc
    Posted 15 years ago #

    When listing your page links in a theme, how can I force it to restructure the links to fit this format...

    <a class="page-item" href="(whatever link is for the WPpage)"><img src="images/link.png" alt="Link" /><span>(The Name of the PAGE)</span></a>

    A normal link on my site looks like this:
    <li class="page_item page-item-2"><a href="" title="About">About</a></li>

    I guess what I am asking is can I remove the

    <li>, Add <a href="link">, then Add <img src="images/link.png" alt="Link" />, then add <span>(Title of Page)</span> 
    I think I have seen this done in function.php.  ANyone care to help get me going?


  2. Klark0
    Posted 15 years ago #

    Why not do it through CSS. Give the navigation li a background image and position it how you want.

  3. kennibc
    Posted 15 years ago #

    Well, I am designing a theme and using a navigation that requires this type of formatting to display properly. Any suggestions?

    I guess I am looking for the hook that will call the link for the page and then the title of the page for. Then in functions.php I can format how the links should appear.

  4. andrea_r
    Posted 15 years ago #

    So you want to replace a page link with an image?

    yeah, it's done via css.

About this Topic

  • Started 15 years ago by kennibc
  • Latest reply from andrea_r