/*
Theme Name: Lucent
Theme URI: https://lucent.qodeinteractive.com
Description: Lighting Shop Theme
Author: Mikado Themes
Author URI: https://qodeinteractive.com
Text Domain: lucent
Tags: one-column, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, custom-menu, featured-images, flexible-header, post-formats, sticky-post, threaded-comments, translation-ready
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
function custom_breadcrumbs() {
    $separator = ' &gt; '; // Separator between links
    $home = 'Home'; // Text for the home link
    $before = '<span class="current">'; // Before the current page link
    $after = '</span>'; // After the current page link

    // Start breadcrumb
    if ( !is_home() && !is_front_page() || is_paged() ) {
        echo '<div class="breadcrumbs">';
        
        // Home link
        echo '<a href="' . home_url() . '">' . $home . '</a>' . $separator;

        // Display page/category links for single posts
        if ( is_single() ) {
            $category = get_the_category();
            if ( $category ) {
                echo '<a href="' . get_category_link( $category[0]->term_id ) . '">' . $category[0]->cat_name . '</a>' . $separator;
            }
            echo $before . get_the_title() . $after;
        }
        // Display links for pages
        elseif ( is_page() ) {
            echo $before . get_the_title() . $after;
        }

        // End breadcrumb
        echo '</div>';
    }
}
