WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Include link category as class (2 posts)

  1. dan121
    Member
    Posted 8 years ago #

    I'm trying display my links list like this, with the link category as a class:

    <ul>
    <li class="cat1"><a href="example1.com">Link 1</a></li>
    <li class="cat2"><a href="example2.com">Link 2</a></li>
    <li class="cat2"><a href="example3.com">Link 3</a></li>
    <li class="cat4"><a href="example4.com">Link 4</a></li>
    <li class="cat3"><a href="example5.com">Link 5</a></li>
    <ul>

    Is there any way to do this? This would get me close, but I have no idea how to add the category to the class:

    <?php get_links('-1', '<li class=>', '</li>', '', FALSE, '_id', FALSE,
    FALSE, 5, FALSE); ?>

  2. dan121
    Member
    Posted 8 years ago #

    Since no one seems to be able to come up with an answer, I wrote a plugin to do it for me. It's just a modification of the get_links function, and can be found here: http://www.wilkinsonweb.com/2006/08/07/links-with-class.

Topic Closed

This topic has been closed to new replies.

About this Topic