bbellx
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Fixing WordPress
In reply to: Sort posts in the Loop with links in the SidebarMy friend Matt suggested this:
Take a look at http://www.dyasonhat.com/wp-smart-sort/ May not be exactly what you’re looking for but it might give you ideas.
Forum: Fixing WordPress
In reply to: Displaying wp_list_pages AND Custom FieldsThe 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.
Forum: Fixing WordPress
In reply to: Displaying wp_list_pages AND Custom FieldsI’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)