// ========================================================================= // FIX BREADCRUMB IN CUSTOM POST TYPE // ========================================================================= function add_custom_breadcrumb(){ if(is_singular('YOUR_CPT')){ if ( function_exists('yoast_breadcrumb') ) : $post_types = array('YOUR_CPT'); ?> <div class="breadcrumb custom"> <span xmlns:v="http://rdf.data-vocabulary.org/#"> <span typeof="v:Breadcrumb"><a href="<?php echo home_url(); ?>/" rel="v:url" property="v:title">Home</a></span> / <a href="#">Page 1</a> / <a href="#">Page 2</a> / <a href="#">Page 3</a> / <?php the_title(); ?> <span typeof="v:Breadcrumb"><strong class="breadcrumb_last" property="v:title"><?php post_type_archive_title(); ?></strong></span> </span> </div> <?php else : yoast_breadcrumb('<div class="breadcrumb"> ','</div>'); endif; } } add_action('genesis_before_loop', 'add_custom_breadcrumb');
Leave a Reply