• I am using this code in my sidebar:

    ‘<?php /* Creates a menu for pages beneath the level of the current page */
    if (is_page() and ($notfound != ‘1’)) {
    $current_page = $post->ID;
    while($current_page) {
    $page_query = $wpdb->get_row(“SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = ‘$current_page'”);
    $current_page = $page_query->post_parent;
    }
    $parent_id = $page_query->ID;
    $parent_title = $page_query->post_title;

    if ($wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_parent = ‘$parent_id’ AND post_status != ‘attachment'”)) { ?>

    <div class=”sb-pagemenu”><h2><?php echo $parent_title; ?> Subpages</h2>

      <?php wp_list_pages(‘sort_column=menu_order&title_li=&child_of=’. $parent_id); ?>

    </div>
    <?php } } ?>’

    Problem is the “Back to” part only shows the site plus the date of the post. How can I make it so the post Back to “Fruit” is linked to Fruit, which is a parent page?

    Also, if the parent has no subs, can it not show any <h2></h2> at all?

Viewing 5 replies - 16 through 20 (of 20 total)
  • How about this…

    open up the fold list PHP file in Notepad. Find this line (line 264): “$output = '';” and change it to “$output = '<ul>';“. And then, line 310: “$output .= "$indent\n";“, change it to “$output .= "$indent\n\n";“.

    See if that helps.

    Thread Starter zonetrap

    (@zonetrap)

    OOOO, not good at all! It brought in the other sidebars into the existing one.

    There must be a away to alter the code I had posted in my first message. I like that format so much better.

    Well, aside from having you take the code I suggested out (which you probably already did), the only other thing I have to offer is to wrap the actual call to the fold page list thing in <ul></ul> tags.

    Other than that, it’s very odd that it’s not working for you. I *really* does look like your links aren’t set up as children in your admin area – why it’s doing that, I don’t know.

    Thread Starter zonetrap

    (@zonetrap)

    No sure either, I think the template had a different look to it.

    Thanks for your help, I appreciated it.

    I am having trouble with using the .page_item and .current_page_parent styling, though I am not using the fold plugin…

    I can get it all to work until I actually click ON the sub (child) page… then the menu displays only the parent page and the current_page item… the siblings of the current page disappear.

    Is there any sibling class I can use?

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Sidebar help’ is closed to new replies.