__( '«', 'business-press' ),
'next_text' => __( '»', 'business-press' ),
) );
}
}
// business_press Breadcrumb
function business_press_breadcrumbs()
{
$custom_taxonomy = '';
// Get the query & post information
global $post,$wp_query;
// Do not display on the homepage
if( !is_front_page() )
{
// Build the breadcrums
echo '
';
}
elseif( is_archive() && !is_tax() && !is_category() && !is_tag() && !is_year() && !is_month() && !is_day() && !is_author() )
{
// If post is a custom post type
$post_type = get_post_type();
// If it is a custom post type display name and link
if( $post_type != 'post' )
{
$post_type_object = get_post_type_object( $post_type );
$post_type_archive = get_post_type_archive_link( $post_type );
echo '
';
}
}
elseif( is_archive() && is_tax() && !is_category() && !is_tag() )
{
// If post is a custom post type
$post_type = get_post_type();
// If it is a custom post type display name and link
if( $post_type != 'post' )
{
$post_type_object = get_post_type_object( $post_type );
$post_type_archive = get_post_type_archive_link( $post_type );
echo '
';
}
elseif( is_single() )
{
// If post is a custom post type
$post_type = get_post_type();
// If it is a custom post type display name and link
if( $post_type != 'post' )
{
$post_type_object = get_post_type_object( $post_type );
$post_type_archive = get_post_type_archive_link( $post_type );
echo '
';
}
// Get post category info
$category = get_the_category();
$last_category = '';
if( !empty( $category ) )
{
// Get last category post is in
$pre_last_category = array_values( $category );
$last_category = end( $pre_last_category );
// Get parent any categories and create array
$get_cat_parents = rtrim( get_category_parents( $last_category->term_id, true, ',' ), ',' );
$cat_parents = explode( ',', $get_cat_parents );
// Loop through parent categories and store in variable $cat_display
$cat_display = '';
foreach( $cat_parents as $parents )
{
$cat_display .= '
'. wp_kses_post( $parents ) .'
';
}
}
// If it's a custom post type within a custom taxonomy
$taxonomy_exists = taxonomy_exists( $custom_taxonomy );
if( empty( $last_category ) && !empty( $custom_taxonomy ) && $taxonomy_exists )
{
$taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );
$cat_id = $taxonomy_terms[0]->term_id;
$cat_nicename = $taxonomy_terms[0]->slug;
$cat_link = get_term_link( $taxonomy_terms[0]->term_id, $custom_taxonomy );
$cat_name = $taxonomy_terms[0]->name;
}
// Check if the post is in a category
if( !empty( $last_category ) )
{
echo $cat_display; //already escaped
//get_the_title intentionally allows for HTML and should not be escaped.
echo '
' . get_the_title() . '
';
// Else if post is in a custom taxonomy
}
elseif( !empty( $cat_id ) )
{
echo '
comment_approved == '0' ) { ?> ' . get_comment_date() . '', get_comment_time() ); ?> $depth, 'max_depth' => $args['max_depth'], 'reply_text' => esc_attr__( 'Reply', 'business-press' ), 'before' => '', 'after' => '' ) ) ); ?>