• Resolved npal.radhika

    (@npalradhika)


    I am trying to use a conditional tag in order to set the breadcrumb of a specific custom post type. However for some reason the condition is not evaluating as true, instead the generic is_single() condition evaluates to be true. Please help. Please find below the code

    if(is_singular(‘practice’)) {
                $parents = array();
                $parent_id = 556;
                while ( $parent_id ) :
                $page = get_page( $parent_id );
                if ( $params["link_none"] )
                    $parents[]  = get_the_title( $page->ID );
                else
                    $parents[]  = '
    <li><a>ID )) . '" title="' . get_the_title( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a></li>
    ' . $separator;
                $parent_id  = $page->post_parent;
                endwhile;
                $parents = array_reverse( $parents );
                echo join( '', $parents );
            }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Conditional Tag’ is closed to new replies.