Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bbellx

    (@bbellx)

    My friend Matt suggested this:

    Take a look at https://www.dyasonhat.com/wp-smart-sort/ May not be exactly what you’re looking for but it might give you ideas.

    Thread Starter bbellx

    (@bbellx)

    The solution thanks to the guiding hand of MichaelH:

    <div id="sidebar-left">
    <ul>
    <li id="parent-page">About</li>
    <?php
    if($post->post_parent)
    $pages = get_pages('title_li=&child_of='.$post->post_parent.'&sort_column=post_date&sort_order=desc&echo=0');
    else
    $pages = get_pages('title_li=&child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&echo=0');
    $count = 0;
    foreach($pages as $page)
    {
    $content = $page->post_content;
    if(!$content)
    continue;
    if($count >= 2)
    break;
    $count++;
    $content = apply_filters('the_content', $content);
    ?>
    <li id="pages"><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></li>
    <li class="sub-list"><?php echo get_post_meta($page->ID,'listdesc',true); ?></li>
    <?php
    }
    ?>
    </ul>
    </div>

    This will display the child pages and the custom field on both the parent page and all child pages. Nice! Much appreciated! You guys are great.

    Thread Starter bbellx

    (@bbellx)

    I’ve looked at those references before, but I’m not sure how to combine them. Any chance someone could explain how to combine the two?

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