freshsauce
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Basic PHP script/syntax help in modifying sidebarDan, this is what your after I think? I’ve added some extra comments, but not sure what you want to put in the else block.
Hope it helps
<?php
// This creates a sub navigation containing the child pages.
if ( is_page() ) { ?><?php
if($post->post_parent)
$children = wp_list_pages(‘title_li=&child_of=’.$post->post_parent.’&echo=0′); else
$children = wp_list_pages(‘title_li=&child_of=’.$post->ID.’&echo=0′);
if ($children) { ?><div class=”childnav”>
<h2>
<?php
$parent_title = get_the_title($post->post_parent);
echo $parent_title;
?>
</h2>-
<?php echo $children; ?>
</div>
<?php } // end if $children
} else {
// not page
} ?>- <?php get_search_form(); ?>
- <h3><?php _e( ‘Archives’, ‘twentyten’ ); ?></h3>
<?php
/* When we call the dynamic_sidebar() function, it’ll spit out
* the widgets for that widget area. If it instead returns false,
* then the sidebar simply doesn’t exist, so we’ll hard-code in
* some default sidebar stuff just in case.
*/
if ( ! dynamic_sidebar( ‘primary-widget-area’ ) ) : ?>-
<?php wp_get_archives( ‘type=monthly’ ); ?>
- <h3><?php _e( ‘Meta’, ‘twentyten’ ); ?></h3>
-
<?php wp_register(); ?>
- <?php wp_loginout(); ?>
<?php wp_meta(); ?>
<?php endif; // end primary widget area ?>