Support » Fixing WordPress » Space in Page List

  • Resolved puremood



    I searched but didn’t see the answer (hope I didn’t miss it).

    Anyway… on my sidebar I have my page list. They all appear correctly except for the last one. There is a space before the last main page.

    If you look you’ll see it active on my site (after military links and before glitter name tags)

    If someone knows how I can remove that space, I’d appreciate it. It slightly irks me 😉

Viewing 14 replies - 1 through 14 (of 14 total)
  • puremood





    most likey because you have about 98 errors of broken elements, elements left out and other problems with the code…

    that is not xhtml valid either with errors…

    fix a lot of that and most likely itll be fixed

    a nice way of doing it is getting the html tidy plugin for firefox and checking your pages with it.. that will give you a start. though its html and not xhtml.. as i said itll give you a start. via tidy, youhave 100 warnings and no errors.. but that translates to 98 xhtml errors



    I knew I had errors… *sigh*

    But for this single issue I wasn’t sure why it was happening… As I have multiple skins/layouts and I don’t have the space on the other layouts just this one. I know HTML but am new to learning all the XHTML/CSS/PHP, etc…

    I’ll figure it out, eventually (I hope). I thought perhaps someone may be able to help me by pin-pointing the problem when I posted this a couple days ago.

    Thank You for your reply.



    <li class="page_item"><a href="" title="Life in the Navy">Life in the Navy</a><ul>

    <li class="page_item"><a href="" title="Military Links">Military Links</a></li>

    <li class="page_item"><a href="" title="Glitter Name Tags">Glitter Name Tags</a>

    are probabally where you problems will be
    close the <li> before you open the <ul>

    <li class="page_item"><a href="" title="Life in the Navy">Life in the Navy</a></li><ul>

    remove the extra </li>
    <li class="page_item"><a href="" title="Military Links">Military Links</a></li></ul>

    same thing here, close one before you open another
    <li class="page_item"><a href="" title="Glitter Name Tags">Glitter Name Tags</a></li><ul>

    then remove the extra one at the bottom
    <li class="page_item"><a href="" title="Military/Patriotic Tags">Military/Patriotic Tags</a></li></ul></ul>



    The code I am using to call my pages:

    <?php wp_list_pages(‘sort_column=menu_order&title_li=’); ?>

    So, I don’t see all the things you see by viewing source. So, I’ll look stupid and admit I’m not sure where to go change that.

    Again, thank you for your reply. I appreciate it.



    Nah, you dont look stupid. I cant see what you are looking at so I do not know what you see to change.. Im sorry 🙁 I wish I knew a better way to help you, I would!

    I could be way off base too.. so there might be a better way.



    No problem. Thanks for trying! 🙂

    I don’t know if you found a solution yet, but the problem lies in the fact that FOR SOME UNKNOWN REASON wp adds two classes when using the php wp_list_pages template tag:
    It adds class=”page_item

    And when it lists child pages using the page_item class it puts the closing tag for the parent pages in the wrong place, as estjohn said.

    I’m trying to modify the template-functions-post.php (the only place I could find the page_item function) page,but so far to no avail!

    I have no idea why WP needs to add those classes. I’ve specified formatting for them in my CSS, but because that closing tag is in the wrong place it doesn’t work.

    I’ve spent HOURS UPON HOURS working on this, so if any one has an idea I SURE WOULD APPRECIATE IT!!!!


    The reason is hardly unkown – it only adds the curent_page_item attribute to the page your currently on, so it’s easy to style the active link, like say you are visiting the “about me” page, so this would be reflected by making “about me” bold, to indicated that is the page you’re on. The wp_list_pages has configurable options, just read the codex page and you can customize it.

    Even if you leave it as is, as long as there is not class defined in your style sheet for the current_page_item, then it will do nothing.

    Good luck,

    Ok, I can see the possibilities. However, I’m getting a big space between the child pages and the parent pages.

    Check out my page:
    actually, check out the ss of the wacky menu, as I’m working on the page and it may not have the same problem when you look at it:


    here is the source:
    <!– begin sidebar –>
    <div id=”menu”>

    <li class=”page_item”>Home

    <li class=”page_item”>Services

    <li class=”page_item”>About
    <li class=”page_item”>Contact Us
    <!– end sidebar –>


    It seems the closing tag for the one page that has child pages has the closing in the wrong place.

    thanks for the encouragement…. {sigh}

    You can adjust the spacing by tweaking the padding and/or margins in the style sheet. I think you’re missing a ul tag, according to the validation results you have 12 errors in your code. Go through that and fix those and it may help clear up the problem.

    If your still having issues after fixing the errors and adjusting your style sheet, post back here.

    Good luck,

    Guess what… I tweaked it to work in FF – sorta, but NATURALLY, it does not work in IE… YET!

    I have faith!

    I went through the whole validation process…
    first time actually. yes. shame on me. It was quite a learning experience.

    Anyway, got most of the errors out of it. Now, the one error left looks as if it coming from the wp_list_pages template tag.

    Got my menu lines mushed together like they should be, but I can’t get IE & FF to play nice with margins & padding. Guess that is a subject for anotheer thread…

    thanks so much for helping me out (i’d be happy to hear what you have to say about the margins, padding, debate. Thanks!)

    a much calmer Kathy

    IE can be very frustrating, see this post, it’s probably not the best solution, but it works for me and it kept me from banging my head on the desk!

    I think you need to add a <ul> right under the <div id="menu"> tag, that’s the only remaining error on your page. Give that a try and see how it works.


Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Space in Page List’ is closed to new replies.