<commit_before><?php

// Based on an example provided on The Web Taylor
// https://www.thewebtaylor.com/articles/wordpress-creating-breadcrumbs-without-a-plugin
// Settings
$breadcrums_id = 'breadcrumb';
$breadcrums_class = $breadcrums_id;
$home_title = __('Home', 'keitaro');

// If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)
$custom_taxonomy = '';

// Get the query & post information
global $post, $wp_query;

if (!function_exists('breadcrumb_item')) :

    function breadcrumb_item($url, $title = '', $wrapper = 'a') {
        printf('<li><%3$s %1$s>%2$s</%3$s></li>', ($url ? 'href="' . $url . '"' : ''), $title, $wrapper);

    }

endif;

if (!function_exists('is_paginated_url')) {

    function is_paginated_url() {
        global $paged;

        if ($paged > 1) :
            $url = get_term_link(get_queried_object()->term_id, get_queried_object()->taxonomy);
        else :
            $url = false;
        endif;

        return $url;

    }

}

// Do not display on the homepage
if (!is_front_page()) {

    // Set default variables for date archive pages
    if (is_date()) :
        $day_display = get_the_time('j');
        $month_numeric = get_the_time('m');
        $month_display = get_the_time('F');
        $year_display = get_the_time('Y');
    endif;

    ?>

    <?php

    // Build the breadcrums
    echo '<ol id="' . $breadcrums_id . '" class="' . $breadcrums_class . '">';

    // Home page
    breadcrumb_item(get_home_url(), __('Home', 'keitaro'));

    if (is_home()) {

        global $paged;

        if ($paged > 1) :
            breadcrumb_item(get_page_link(get_queried_object()->ID), get_queried_object()->post_title);
        else :
            breadcrumb_item(false, get_queried_object()->post_title, 'span');
        endif;
    } elseif (is_post_type_archive()) {
        breadcrumb_item(false, post_type_archive_title(false), 'span');
    } 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') {

            breadcrumb_item(get_post_type_archive_link($post_type), get_post_type_object($post_type)->labels->name);
        }

        breadcrumb_item(false, get_queried_object()->name, 'span');
    } 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') {
            breadcrumb_item(get_post_type_archive_link($post_type), get_post_type_object($post_type)->labels->name);
        }

        // Get post category info
        $category = get_the_category();

        if (!empty($category)) {

            $cat_array = array_values($category);

            // Get last category post is in
            $last_category = end($cat_array);

            // 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 .= '<li class="item-cat">' . $parents . '</li>';
            }
        }
        // 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;

            breadcrumb_item(false, get_the_title(), 'span');
<commit_msg>Update breadcrumb output for Pages and Posts<commit_after><?php

// Based on an example provided on The Web Taylor
// https://www.thewebtaylor.com/articles/wordpress-creating-breadcrumbs-without-a-plugin
// Settings
$breadcrums_id = 'breadcrumb';
$breadcrums_class = $breadcrums_id;
$home_title = __('Home', 'keitaro');

// If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)
$custom_taxonomy = '';

// Get the query & post information
global $post, $wp_query;

if (!function_exists('breadcrumb_item')) :

    function breadcrumb_item($url, $title = '', $wrapper = 'a') {
        printf('<li><%3$s %1$s>%2$s</%3$s></li>', ($url ? 'href="' . $url . '"' : ''), $title, $wrapper);

    }

endif;

if (!function_exists('is_paginated_url')) {

    function is_paginated_url() {
        global $paged;

        if ($paged > 1) :
            $url = get_term_link(get_queried_object()->term_id, get_queried_object()->taxonomy);
        else :
            $url = false;
        endif;

        return $url;

    }

}

// Do not display on the homepage
if (!is_front_page()) {

    // Set default variables for date archive pages
    if (is_date()) :
        $day_display = get_the_time('j');
        $month_numeric = get_the_time('m');
        $month_display = get_the_time('F');
        $year_display = get_the_time('Y');
    endif;

    ?>

    <?php

    // Build the breadcrums
    echo '<ol id="' . $breadcrums_id . '" class="' . $breadcrums_class . '">';

    // Home page
    breadcrumb_item(get_home_url(), __('Home', 'keitaro'));

    if (is_home()) {

        global $paged;

        if ($paged > 1) :
            breadcrumb_item(get_page_link(get_queried_object()->ID), get_queried_object()->post_title);
        else :
            breadcrumb_item(false, get_queried_object()->post_title, 'span');
        endif;
    } elseif (is_post_type_archive()) {
        breadcrumb_item(false, post_type_archive_title(false), 'span');
    } 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') {

            breadcrumb_item(get_post_type_archive_link($post_type), get_post_type_object($post_type)->labels->name);
        }

        breadcrumb_item(false, get_queried_object()->name, 'span');
    } elseif (is_singular()) {

        // 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') {
            breadcrumb_item(get_post_type_archive_link($post_type), get_post_type_object($post_type)->labels->name, 'span');
        } else {
            breadcrumb_item(get_post_type_archive_link('post'), get_the_title(get_option('page_for_posts')));
        }

        // Get post category info
        $category = get_the_category();

        if (!empty($category)) {

            $cat_array = array_values($category);

            // Get last category post is in
            $last_category = end($cat_array);

            // 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 .= '<li class="item-cat">' . $parents . '</li>';
            }
        }
        // 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) && !is_singular()) {
            echo $cat_display;

            breadcrumb_item(false, get_the_title(), 'span');

{'fraction_non_alphanumeric': 0.1425561797752809, 'fraction_numerical': 0.0023408239700374533, 'mean_word_length': 2.619229140194833, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 55, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2548150', 'n_tokens_mistral': 2760, 'n_tokens_neox': 2673, 'n_words': 593}