• Hey,

    I was wondering if there is a way to configure the wp_list_pages function.

    I’m currently using the following to output my navigation:
    <?php wp_list_pages(‘include=4,5,6,7,8,9,10&sort_column=menu_order&title_li=’); ?>
    However, would like to have it output(without the extra ‘tag’ and ‘aa) parts, just did them to get round the filtering ?? :

    <li tag><div class=”class name”>LINK TEXT HERE</div>
    <li tag><div class=”class name”>LINK TEXT 2 HERE</div>
    Is it possible to edit the wp_list_pages part?

    Many thanks.

Viewing 15 replies - 1 through 15 (of 17 total)
  • If you know code (PHP) you can edit whatever file you want… and then update it every time when a WP upgrade comes around ??

    (and if you know what to edit, you should be able to find it, too)

    I assume you saw the article about this tag in the Codex:
    Template_Tags/wp_list_pages

    Thread Starter michaelmcguk

    (@michaelmcguk)

    Thanks for the reply.

    Yes, I looked at this however, it didn’t seem to do what I was after.

    I’d like to have the following, but can’t seem to get in and edit the wp_list_page:

    <li class="part name part name 2"><a href="#"><div class="class name">LINK TEXT HERE</div></a></li> ??

    Because of my unordered list, I want to format the links using the ‘class name’ part of that div, but I can’t seem to get in there and edit it. It just echo’s out the links:

    <li class="part name part name 2"><a href="#">LINK TEXT HERE</a></li> ??

    Should I use something similar to this where they’ve added a style?

    <ul>
    <?php
    global $id; // teensy bit insane, sorry
    $date_format = '<\b\r /><\s\p\a\n '. '\s\t\y\l\e="\f\o\n\t-\s\i\z\e: \s\m\a\l\l\e\r">'. '\l\a\s\t\m\o\d Y-n-j</\s\p\a\n>'; wp_list_pages("title_li=&child_of=$id&show_date=modified
    &date_format=$date_format"); ?>
    </ul>

    Any help would be great.

    The template tag does add a class to the output of every list item + another one for the current list item.
    Usually, that is enough for any kind of styling.

    Isn’t that enough for you? Just curious…

    Thread Starter michaelmcguk

    (@michaelmcguk)

    It’s not so much the styling of the list item.
    I require styling (and the inclusion of) the <div> tag within the list item, so I can style the text.

    I require styling (and the inclusion of) the <div> tag within the list item
    That’s invalid nesting and bad code. You may want to re-think your strategy…

    Thread Starter michaelmcguk

    (@michaelmcguk)

    How should I re-think it?

    Can I have an example that would work with WP?

    Here’s the code I want to apply to the text:

    ‘.one {
    margin-left:10px;
    margin-right:10px;
    margin-top:10px;
    font-weight:bold;
    }’

    Instead of complicated technical questions you should just always ask a straight question: how do I get this or that end result.
    I guess you want dynamic highlighted menu. Why else would you want that “one” class?

    Thread Starter michaelmcguk

    (@michaelmcguk)

    Uhm ok.
    It’s a bit complicated, but some of the links run over 2 lines, so I had two classes. The second one for the longer lines:
    ‘.two {
    margin-left:10px;
    margin-right:10px;
    margin-top:2px;
    font-weight:bold;
    }’

    So, could you point me in the right direction for the dynamic highlighted menus.

    I really just wanted to place it in a div to give some ‘padding’ to the text in the box, using the above css. It does it in my pre-WP template, but not in my WP one.

    Thanks for your patience with this issue.

    Thread Starter michaelmcguk

    (@michaelmcguk)

    Hmm, it might actually make sense just to create my own function for this purpose. Cheers.

    Thread Starter michaelmcguk

    (@michaelmcguk)

    I just need to style the text within the
    <li> item.

    How can I do this?

    I did try, to no avail, this:

    li.page_item page-item-4,li.page_item page-item-5,li.page_item page-item-8 {
    		 margin-left:10px;
    		 margin-right:10px;
    		 margin-top:10px;
    		 font-weight:bold;
    }
    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    <li class="part name part name 2"><a href="#"><div class="class name">LINK TEXT HERE</div></a></li>

    Okay, even if that was nested correctly (it’s not), I don’t understand why you’d need the div. I mean, you’re just adding a class, but the thing already has a class. It would be li.classname a { whatever; }… Adding extra container DIVs and SPANs and such when the thing is already inside a container is extremely silly.

    For CSS, it is extremely rare that WordPress’ core code needs modification. There’s virtually always a way to do what you want without rolling your own code. It’s just a matter of looking at it correctly.

    Post a link so we can see the HTML list being produced ourselves (without the extra “div”). Then tell us how you want it styled. Then we’ll tell you the CSS you need to do it.

    Thread Starter michaelmcguk

    (@michaelmcguk)

    OK.

    HTML :

    <ul id="navlist">
    <li class="page_item page-item-4"><a href="blabla.php">asasas</a></li></ul>

    CSS:

    li.page_item page-item-4 a {
    		 margin-left:10px;
    		 margin-right:10px;
    		 margin-top:10px;
    		 font-weight:bold;
    }

    Is there something obvious I’m doing wrong, as I’m still not getting the desired effect.

    Again, thanks for the help fella’s, sure we’re almost there.

    Thread Starter michaelmcguk

    (@michaelmcguk)

    Can I PM/email you the link Otto, I’d prefer not to make it public?

    Thread Starter michaelmcguk

    (@michaelmcguk)

    Anyone? Anyone? Bueller?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘‘wp_list_page’ configuration?’ is closed to new replies.