• I can’t find anything regarding this function so here’s my story.

    I’m using 1.5-beta-1 2005-01-27 and tried to modify the Pages list (normally in sidebar.php) into a horizontal bar which I put in the header.php. But discovered an obsolete “ul” “/ul” tag when displaying with depth=1 for children post. This gave me extra space below my menu bar.

    After modifying a piece of code of the function _page_level_out() (./wordpress/wp-includes/template-functions-post.php) in
    ...
    if(isset($cur_page["children"]) && is_array($cur_page["children"])) {
    $new_depth = $depth + 1;

    if(!$args["depth"] || $depth < ($args["depth"]-1)) {
    echo "$indent<ul>\n";
    _page_level_out($page_id,$page_tree, $args, $new_depth);
    echo "$indent</ul>\n";
    }
    }

    ...

    everything worked as expected with and without title or depth.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hmmmm… This is very interesting. I have been frantically trying to customize the way that pages displays, but I have very limited php ability. I guess I need to hit the books to edit the pages formatting.

    May I ask why you are editing this code? Because I have a suspicion that I am attempting the same edit.

    Thread Starter peer

    (@peer)

    I want all of my top pages to look like a horizontal menu bar at the top of my screen. A bit like the menu at WordPress. If I do that with wp_list_pages(‘title_li=&depth=1’) I get an ugly space below my bar due to unneccessary ULs. With this modification they’re gone like they should.

    in the mean time (assuming your ul is inside a div with id hmenu) something like

    #hmenu li ul {
    display: none;
    }

    Should be able to patch the problem in css.

    Thread Starter peer

    (@peer)

    Thanks Womby, this works great!

    BTW I’ve been looking through all functions and serched the forum but seem not to be able to find what I’m looking for. I need a function that tells me the ID of the top page (the one without a parent) of the current page.

    Why? Because I need this in order to present me a 2nd bar with all the first level children (wp_list_pages () with the option child_of) and to keep it there when I click the link. Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Minor bug in function _page_level_out ()’ is closed to new replies.