WordPress.org

Forums

wp_list_pages styling (5 posts)

  1. ttech5593
    Member
    Posted 9 years ago #

    Hi,
    Just have one quick question, I know there is a way to style wp_list_pages but I don't know how. Also, I have a css tag that is set up so it does the following:
    Content
    Sub Content
    Sub Sub Content
    but it just uses 1 tag or two. :-) But it only works if I can set how WordPress puts in the tag for the different parts in the "Tree". Thanks...

  2. krugern
    Member
    Posted 9 years ago #

    sure, I did this myself only minutes ago with css!

    open your wp-includes/template-functions-post.php and locate this line: function wp_list_pages($args = '') {.

    10 lines further down you will find this line: $output .= "<li>" . $r["title_li"] . "<ul>";.

    Add class=\"pages\" to the <ul>.

    Make an imagetag for the Sub-pages and another one for the subsub-pages, and go to your CSS file and add these lines:

    ul.pages ul li:before {
    content: url('wp-content/themes/YOURTHEME/images/subpages.png');
    }

    ul.pages ul ul li:before {
    content: url('wp-content/themes/YOURTHEME/images/subsubpages.png');
    }

    give it a try. should work for you if you get what i'm talking about :)

  3. ttech5593
    Member
    Posted 8 years ago #

    krugern, Thanks...
    THe class part is good but if I understand you correctly I should be able to change the
    <ul> to li? Also is there a way to do what I want with out modifying the WP functions? Because as soon as I upgrade I will have to do the same thing again.

  4. pixeldiva
    Member
    Posted 8 years ago #

    I echo ttech5593. How can we modify the WP functions without upgrading becoming a hassle?

  5. jwurster
    Member
    Posted 8 years ago #

    I'm kind of a newbie on css, but if you want to change the ul and li items, you could change them in the stylesheet. However, that would probably change them everywhere, which is what you don't want. The suggestion was to change the function to add a class to it, so that you could then add this to the stylesheet. But then you would loose this on the next upgrade.

    Maybe it would be good to have different internal wp functions each have their own class, so that each can be customized.

    And there are some replacement plugins like http://www.webspaceworks.com/resources/wordpress/31/.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags