WordPress.org

Support

Support » Themes and Templates » [Resolved] pages, categories, archives, links with NO li list tag?

[Resolved] pages, categories, archives, links with NO li list tag?

  • The codex seems to be down and the search doesn’t bring up any useful information (mostly pages from the codex and release posts)…

    I’m wondering if there is a way to make wordpress NOT use lists for the various sidebar links like pages, archives, categories, links, etc? So that they are just regular links with no styling to them?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Valerie
    Member

    @bunnygirl

    Remove the styling in your stylesheet. Something like:

    ol {
    padding: 0;
    margin-left: 0;
    }

    ul {
    list-style-type: none;
    padding: 0;
    margin-left: 0;
    }

    The problem with that is that the links are still hardcoded in the php files to have
    < li > tags on them.

    Is there a way (which file could I edit) to take away the < /li >
    < li > coding on the sidebar links that wordpress generates.
    I know I can style them to be normal, but that doesn’t make them not have the < /li >
    < li > wrapper (which can mess up other styling

    Valerie
    Member

    @bunnygirl

    If you want to remove the list elements from the link category headers:

    In wp-includes/links.php around line 548, find
    // Display the category name

    Just below it, where it says
    echo ' <li id="linkcat-' . $cat['link_category'] . '"><h2>' . $cat['cat_name'] . "</h2>nt<ul>n";

    Change to
    echo '<h4>' . stripslashes($cat['cat_name']) . "</h4>n<ul>tn";

    Then you can define how the headings look with the h4 declaration in your stylesheet.

    To remove the list elements from all links , remove the <ul> tag in the above code. Then, on line 551, remove the <li></li> codes. Then remove </ul> from line 560.

    That takes care of the links. For categories, you will want to look at wp-includes/templates-functions-category.php and do a similar thing.

    I’m wondering if there is a way to make wordpress NOT use lists for the various sidebar links like pages, archives, categories, links, etc? So that they are just regular links with no styling to them?

    I know I can style them to be normal, but that doesn’t make them not have the [li][/li] wrapper (which can mess up other styling)

    If you’re only concerned with how the sidebar items look, it’s probably possible to style those however you want without affecting anything else. You’d want to use something like

    `#sidebar li {
    list-style: none;
    /* etc */
    }

    …not just a generic list selector — but it all depends on what you want for “just regular links with no styling to them”.

    Wow sweet Im happy to find this post ive been looking in wrong spot since I have an embedded WP and was having trouble finding some the hardcoded style info, I need to be able to style the catagory and archives title and list seperatly.. by adding a class to each(preferably) or using an existing one in my stylesheet, as well as get rid of the bullet style list.

    Im not sure where in templates-functions-category.php, I can add this info as I see the styles around line 377 and more around line 56.

    I also need this for the archives but am not sure which .php to edit.

    This custom info would not only help me a great deal but several people who are having similair issues with the joomla-wp-sidebar, and a fix will be posted with included files to that community if someone can help me out.

    Thanks

    Just an update if its not possible to add a class to individual php files can I add a class to something like this?

    if($show_cats == 1) {<br />
    $content .="Categories";<br />
    $content .='
    <ul>';<br />
    ob_start();<br />
    list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 1, $hide_empty = 0, $use_desc_for_title = 1, $children=true, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=true);<br />
    $content .= ob_get_contents();<br />
    ob_end_clean();<br />
    $content .='</ul>
    ';

    been trying to fix this for over a week and the guy who made the sidebar module hasnt been around.

    There is and are codes or plugins rather, to do this for you, instead of having to use all that “call tag” stuff in the sidebar.php file..

    There is plugins such as “get recent comments”, to display the number of posts as well as the “title: of the comment. So it’s shown in the sidebar.

    Plugin Name: Get Recent Comments
    Version: 1.2
    Plugin URI: http://blog.jodies.de/archiv/2004/11/13/recent-comments/
    Author: Krischan Jodies
    Author URI: http://blog.jodies.de
    Description: Display the most recent comments or trackbacks with your own formatting in the sidebar.

    a catagory….just use this call tag in your sidebar.php file:
    <?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','','','') ?>

    If you want that even specified more, there is plugins available, and for the other..there’s a list of links to places for plugins.
    http://wordpress.org/extend/plugins/

    spencerp

    I hope the info I gave helps..or maybe I’m not following you’re plans just right…I’m not sure.. :/

    Thanks for the reply unfortunatly that wont help, I as well as several other people are using an embedded version of wordpress that has its own custom module for displaying the sidebar ( http://www.joomladeveloping.org ).
    So editing the sidebar.php, index.php, as well as the default joomla and wordpress embedded style sheets have 0 effect on the display of the sidebar due to the fact that its customized…
    now the problem is this customization contains no class info to style the sidebar ( the developer has not been around for a week:( )
    SO I figure I need to somehow hardcode it into some of the wordpress php files (see above) or somehow get it into the custom sidebar which im unfamiliar with.

    still stumped

    Damn! Just re-read my own stuff and smacks self….I’m totally talking in circles along with a “hint” of hypocrit….shit.. lol! Sorry about that dotnature =( I better go to bed now lol..and stop drinking.. =)

    Valerie
    Member

    @bunnygirl

    Dotnature: Im not sure where in templates-functions-category.php, I can add this info as I see the styles around line 377 and more around line 56.

    In the template-functions-category.php file, go to line 375 where it says
    $thelist .= ">$linkn";
    and remove the >

    Then, on line 371, remove the <li and on line 383 remove </li>

    That should do the trick for removing list items from the categories. I’ve not done that with my archives since I have the dropdown, so I will work on that and post if I figure it out.

    thanks bunny I found this right before you posted , removing the li on 369 and 374 did the trick, unfortunatly Ive realized this isnt really a good solution, as it hasnt help me define a class I can style and changing the hardcode for is prob not a good idea, any idea how I can define a class for these elements so I can just change the stylesheet?

    Valerie
    Member

    @bunnygirl

    Try replacing the <li> codes with something to the effect of

    <li class="category">

    and then defining the the class category in your stylesheet?

    Valerie
    Member

    @bunnygirl

    In case anyone still wants it…to remove the list elements from your archives:

    In wp-includes/template-functions-general.php remove the <li> and </li> from line 273.

    That should do the trick!

    thanks bunny I tried several spots to enter a class= but I always get errors that basically what im trying to figure out, where to define a new class for the catagory title and list.

    Thanks for the file locations bunnygirl!

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘[Resolved] pages, categories, archives, links with NO li list tag?’ is closed to new replies.