Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • We’ve used PHP Tidy extension to cleanup generated HTML, solved our problems for now.

    alexbalint

    (@alexbalint)

    Try using an undocumented option (at least I couldn’t find any reference to it) – hierarchical=0

    <?php wp_list_pages("include=40,41&title_li=<strong>&hierarchical=0</strong>"); ?>

    Works for me fine.
    Alex

    Hi there – found a solution! I needed this to show a full category tree in the sidebar, but the image idea is great also ??

    The code is this:

    function get_topLevelParent ($postid) {
    $pdata = get_post($postid);
    $parent = $pdata->post_parent;
    if ($parent != 0) {
    $r = get_topLevelParent($parent);
    } else {
    $r = $postid;
    }
    return $r;
    }

    This function returns the top-level parent of any post. You can use it to build a sidebar with all children of a ‘master category’.

    You can feed the current post ID to the function (it should work, I gave the parent ID anyway). Hope this solves your problem (even a little bit late ?? )

Viewing 3 replies - 1 through 3 (of 3 total)