WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Applying a class to the blogroll <ul> (3 posts)

  1. mickieluv
    Member
    Posted 8 years ago #

    Hello all,

    I'm very new to wordpress, and although I am making good progress with my theme I'm struggling to find a way to add a class to the
    ul that surrounds the blogroll list.

    My theme is based on Kubrick, so the blogroll code (in sidebar.php) looks like this


    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    <?php get_links_list(); ?>

    Obviously this doesn't allow me access to the

    ul tag itself as the meta or categories lists do, so how do I achieve this?

    I've search for the get_links_list function and found what I think is the right piece of code in wp-includes/links.php starting at line 548



    // Display the category name
    echo ' <li id="linkcat-' . $cat['link_category'] . '"><h2>' . $cat['cat_name'] . "</h2>nt
    <ul>n";
    // Call get_links() with all the appropriate params
    get_links($cat['link_category'],
    '
    <li>',"</li>
    ","n",
    bool_from_yn($cat['show_images']),
    $orderby,
    bool_from_yn($cat['show_description']),
    bool_from_yn($cat['show_rating']),
    $cat['list_limit'],
    bool_from_yn($cat['show_updated']));

    // Close the last category
    echo "nt</ul>
    nn";

    But when i add class="something" to the ul in the following code



    "</h2>nt
    <ul>n";
    </ul>

    my blog doesn't work anymore: can anyone tell me the correct way to do this? I've searched the forum but cannot find anything directly relevant.

    Any help here would be most appreciated.
    Mike

  2. maerk
    Member
    Posted 8 years ago #

    Use class='something' -- with single quotes. Or you can escape the quotes: class="something".

    Edit: Dammit, forums stripped out the slash. To escape quotes put a backslash directly before the "

  3. mickieluv
    Member
    Posted 8 years ago #

    fantastic, thanks very much for your time
    I'll give it a try straight away

Topic Closed

This topic has been closed to new replies.

About this Topic