WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] pages, categories, archives, links with NO li list tag? (20 posts)

  1. Rodney
    Member
    Posted 8 years ago #

    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?

  2. Valerie
    Member
    Posted 8 years ago #

    Remove the styling in your stylesheet. Something like:

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

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

  3. Rodney
    Member
    Posted 8 years ago #

    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

  4. Valerie
    Member
    Posted 8 years ago #

    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.

  5. Sam_a
    Member
    Posted 8 years ago #

    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".

  6. dotnature
    Member
    Posted 8 years ago #

    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

  7. dotnature
    Member
    Posted 8 years ago #

    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.

  8. spencerp
    Member
    Posted 8 years ago #

    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.. :/

  9. dotnature
    Member
    Posted 8 years ago #

    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

  10. spencerp
    Member
    Posted 8 years ago #

    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.. =)

  11. Valerie
    Member
    Posted 8 years ago #

    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.

  12. dotnature
    Member
    Posted 8 years ago #

    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?

  13. Valerie
    Member
    Posted 8 years ago #

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

    <li class="category">

    and then defining the the class category in your stylesheet?

  14. Valerie
    Member
    Posted 8 years ago #

    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!

  15. dotnature
    Member
    Posted 8 years ago #

    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.

  16. Rodney
    Member
    Posted 8 years ago #

    Thanks for the file locations bunnygirl!

  17. Valerie
    Member
    Posted 8 years ago #

    rodneyb: You're welcome!

    dotnature: Have you tried adding it to the <ul> tag? Most of them seem to have a class there already, so if it doesn't by default, it should be able to accept one. The other alternative is in your stylesheet to include

    #sidebar li{ style; }

    assuming your archives/links/categories are in your sidebar. If not, just use whichever div they are in. The down side to this is that all <li>s in your sidebar will have the same styling...but that may not be such a bad thing. Uniformity is good in design, right? ;-)

  18. dotnature
    Member
    Posted 8 years ago #

    Ya I did add the ul tag and it worked :) for list-style: none; as well as font-size but thats about it , for some reason I cannot format the alignment ( like margin or padding or align) as well as some of the colors wierdness.

  19. Valerie
    Member
    Posted 8 years ago #

    Do you mind if I see your code? I might be able to better help you if I can see what you're trying to do.

  20. dotnature
    Member
    Posted 8 years ago #

    I was able to fix it, it was fairly complicated but in end I had to customize the module's php files to include a class when calling an element, actually ended up customizing 3 areas, the css, the modules php, and a joomla xml file to get what I wanted, the developer will prob include some those changes in his next release, thanks for help bunny.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags