Active sibling shows in sibling list – on one page only
-
While the list of sibling pages normally displays without showing the currently active sibling, on one page the current page does show on the sibling list. This page has the same parent, and uses the same template as its siblings, but with some conditional code. I don’t understand why the conditional coding causes the active page to show on the sibling list.
https://dev.dekalbpeds.com.php53-13.ord1-1.websitetestlink.com/about-our-practice/providers/<?php get_header(); ?> <div class="units-row units-split page-main"> <!-- this is not a sidebar, no reason to put it below content. Display:none on mobile --> <div class="unit-25"> <?php if( $post->post_parent == '11') { //resources $id = wp_get_post_parent_id( $post_ID ); ?> <h2> <?php echo get_the_title( $id ); ?> </h2> <hr> <?php echo do_shortcode('[child_pages siblings="true" cols="1" id="$id" link_titles="true" class="cp-list" list="true"]'); } elseif( $post->post_parent == '13') { //pediatric $id = wp_get_post_parent_id( $post_ID ); ?> <h2> <?php echo get_the_title( $id ); ?> </h2> <hr> <?php echo do_shortcode('[child_pages siblings="true" cols="1" id="$id" link_titles="true" class="cp-list" list="true"]'); } elseif( $post->post_parent == '15') { //services $id = wp_get_post_parent_id( $post_ID ); ?> <h2> <?php echo get_the_title( $id ); ?> </h2> <hr> <?php echo do_shortcode('[child_pages siblings="true" cols="1" id="$id" link_titles="true" class="cp-list" list="true"]'); } elseif( $post->post_parent == '17') { //about $id = wp_get_post_parent_id( $post_ID ); ?> <h2> <?php echo get_the_title( $id ); ?> </h2> <hr> <?php echo do_shortcode('[child_pages siblings="true" cols="1" id="$id" link_titles="true" class="cp-list" list="true"]'); } ?> </div> <div class="unit-75 page-content unit-push-right"> <?php if( is_page(23)){ //Are we on the Providers page? It behaves differently within the CC-Childpages plugin if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <p><?php the_content(); ?></p> <?php if(have_rows('provider') ): ?> <?php while(have_rows('provider') ) : the_row(); ?> <div class="units-row end provider "> <div class="unit-20 provider-pic"> <img class="thumb" src="<?php the_sub_field('provider_pic'); ?>" width="175" height="250"> </div> <div class="unit-75"> <h3><?php the_sub_field('provider_name'); ?>, <?php the_sub_field('provider_credentials'); ?></h3> <p><?php the_sub_field('provider_bio'); ?></p> </div> </div> <?php endwhile; ?> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <?php endif; ?> <?php } else { ?> <?php if ( have_posts() ) : ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <div class="alignright"> <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail('medium'); } else{ echo '<img class="alignright" alt="image unavailable" src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/thumb-temp.jpg" />'; } ?> </div> <?php the_content(); ?> <?php endwhile; ?> <?php else : ?> <?php endif; ?> <?php }; ?> </div> </div> </div> <?php get_footer(); ?>
Maybe this is the same issue as discussed here?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Active sibling shows in sibling list – on one page only’ is closed to new replies.