php - AVADA Wordpress Custom Taxonomy Sidebar -
i have custom wordpress taxonomy called 'directory-category' posts sitting in each relevant category within taxonomy.
i'm using avada template hope use sidebar mechanism, i'm unable modify (successfully) code not list page ancestors, rather, listing categories within taxonomy , posts within categories.
here current sidebar helper function building sidebar menu based on pages / page ancestors;
$html = '<ul class="side-nav">'; $post_ancestors = get_ancestors( $post_id, 'page' ); $post_parent = end( $post_ancestors ); $html .= '<li'; if( is_page( $post_parent ) ) { $html .= ' class="current_page_item"'; } if( $post_parent ) { $html .= sprintf( '><a href="%s" title="%s">%s</a></li>', get_permalink( $post_parent ), __( 'back parent page', 'avada' ), get_the_title( $post_parent ) ); } else { $html .= sprintf( '><a href="%s" title="%s">%s</a></li>', get_permalink( $post_id ), __( 'back parent page', 'avada' ), get_the_title( $post_id ) ); } if( $post_parent ) { $children = wp_list_pages( sprintf( 'title_li=&child_of=%s&echo=0', $post_parent ) ); } else { $children = wp_list_pages( sprintf( 'title_li=&child_of=%s&echo=0', $post_id ) ); } if ( $children ) { $html .= $children; } $html .= '</ul>'; return $html;
i appreciate if able assist!
Comments
Post a Comment