Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Child Page Menu Before Primary Sidebar Pagelines
/**
* List child pages in content area
*/
function base_list_children() {
global $post;
$page_ID = $post->ID;
$ancestors = get_post_ancestors($page_ID);
$children = wp_list_pages("child_of=$page_ID&echo=0");
if( $children ) {
$parent = $post->ID;
} elseif ( $ancestors ) {
$parent = $post->post_parent;
}
if( isset($parent) ) {
$section = get_the_title($parent);
$childlist = wp_list_pages("title_li=&child_of=$parent&echo=0");
if( $childlist ): ?>
<div id="child-pages" class="widget">
<div class="widget-pad">
<div class="textwidget sub-nav">
<ul>
<h3><?php $permalink = get_permalink($post->post_parent); ?>
<a href="<?php echo $permalink; ?>"> <?php echo $section ?></a></h3>
<?php echo $childlist; ?>
</ul>
</div>
</div>
</div><!--// end #child-pages -->
<?php
endif;
}
}
add_action('pagelines_before_sb_primary','base_list_children');/* Change Pagelines Default Widget */
@ellenmva
Owner

Add to child theme functions.php file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.