WordPress.org

Support

Support » Themes and Templates » [Resolved] Applying a class to the blogroll <ul>

[Resolved] Applying a class to the blogroll <ul>

  • 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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 ”

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Applying a class to the blogroll <ul>’ is closed to new replies.