Closed getdave closed 10 years ago
Currently there are too many sidebars appearing in projects. Specifically I've noticed:
wp_list_pages()
Can we standardise our sidebars to
wp_list_pages
An example markup is below...
<?php /** * CPT Sub Navigation */ $pt_obj = get_post_type_object( get_post_type() ); //requires cpt to be defined as 'hierarchical' => true $args = array( 'post_type'=>$pt_obj->name, 'sort_column' => 'menu_order, post_title', 'sort_order' => 'ASC', 'title_li'=> false, 'echo'=>0 ); $list_pages = wp_list_pages( $args ); $section_title = $pt_obj->labels->name; ?> <?php if( $list_pages ) : ?> <aside class="sidebar sidebar--nav-<?php echo $pt_obj->name; ?>"> <h5 class="h4"><?php echo ucwords(esc_html($section_title)); ?></h5> <ul class="block-list block-list--dashed"> <?php echo $list_pages; ?> </ul> </aside> <?php endif; ?>
Currently there are too many sidebars appearing in projects. Specifically I've noticed:
wp_list_pages()
which auto-handles the "active" classes...etcCan we standardise our sidebars to
wp_list_pages
An example markup is below...