WordPress.org

Ready to get started?Download WordPress

Forums

Link Categories (5 posts)

  1. marky
    Member
    Posted 10 years ago #

    I dislike how the <?php get_links_list(); ?> function outputs the category headers in a nested list with a class id. (Actually I find it a little presumptuous to automatically assign the categories a class id; what if I happened to have another id with the same name already in my document?)
    Is there any way to modify the results so the categories and links are output as below? I understand I can replace the

  2. tags with <dd>, but that doesn't change how the categories are represented.
    <dl>
    <dt>Category 1</dt>
    <dd>Link 1</dd>
    <dd>Link 2</dd>
    <dt>Category 2</dt>
    <dd>etc...</dd>
    </dl>

  • carthik
    Member
    Posted 10 years ago #

    A dl is used for a defintion list. The categories, or the links above, are not not lists of definitions, they are, at best, an unordered list, which is why they are the way the are.
    The function get_links_list returns an unordered list of links, as should be expected, I guess.
    That said, you could write your own functions to custom ends.

  • marky
    Member
    Posted 10 years ago #

    I don't need XHTML advice, thank-you-very-much. ;-)
    A definition list is absolutely appropriate for a list of links, it's even suggested inside one of the W3C's documents as an example, and there's an A List Apart article explaining why this is appropriate. That aside, I don't think I should have to delve into the PHP code and modify the function to alter the output of this function. If I can replace the list tags, why not the category ones?

  • marky
    Member
    Posted 10 years ago #

    Sorry, it wasn't A List Apart, but this page.

  • carthik
    Member
    Posted 10 years ago #

    Sorry marky, I am often wrong.
    you could post the proposed change as a feature request, or make the changes yourself and make it available to the others and the devs
    :)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.