Integration With Franz Joseph Theme
-
I’m trying to integrate Nav Menu Roles with my theme and I am having some difficulty figuring out how to do so.
I did get a chunk of the function code, but to be quite honest I’m at a loss as to how to tie this in with my theme’s coding.
Any help on the matter would be very much appreciated!
Below is the code that’s in the theme that I need assistance with:
/** * List subpages of current page */ function franz_page_navigation(){ $current = get_the_ID(); $ancestors = get_ancestors( $current, 'page' ); if ( $ancestors ) $parent = $ancestors[0]; else $parent = $current; $args = array( 'post_type' => array( 'page' ), 'posts_per_page' => -1, 'post_parent' => $parent, 'orderby' => 'title', 'order' => 'ASC' ); $children = new WP_Query( apply_filters( 'franz_page_navigation_args', $args ) ); if ( $children->have_posts() ) : ?> <div class="widget"> <h3 class="section-title-sm"><?php _e( 'In this section', 'franz' ); ?></h3> <div class="list-group page-navigation"> <a class="list-group-item parent <?php if ( $parent == $current ) echo 'active'; ?>" href="<?php echo esc_url( get_permalink( $parent ) ); ?>"><?php echo get_the_title( $parent ); ?></a> <?php while ( $children->have_posts() ) : $children->the_post(); ?> <a class="list-group-item <?php if ( get_the_ID() == $current ) echo 'active'; ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php endwhile; ?> </div> </div> <?php endif; wp_reset_postdata(); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Integration With Franz Joseph Theme’ is closed to new replies.