Home / breadcrumbs / Simple breadcrumbs
  • How to Simple breadcrumbs

    no thumbnail sorry: Simple breadcrumbs

    Add the first snippet of code to your wordpress functions.php. Then add the second block of code to your theme in the place you wish to display your breadcrumbs.

    ( click code to copy )

    wordpress snippet : PHP - functions.php

    <>
    function the_breadcrumb() {
    	echo 'You are here: ';
    	if (!is_front_page()) {
    		echo '<a href="';
    		echo get_option('home');
    		echo '">Home';
    		echo "</a> » ";
    		if (is_category() || is_single()) {
    			the_category(' ');
    			if (is_single()) {
    				echo " » ";
    				the_title();
    			}
    		} elseif (is_page()) {
    			echo the_title();
    		}
    	}
    	else {
    		echo 'Home';
    	}
    }
    
    ( click code to copy )

    wordpress snippet : PHP

    <>
    <?php
              the_breadcrumb();
    ?>
    

    ( WordPress codex functions, hooks, in this snippet. )

    home, the_title, the_category, is_single, is_page, is_category, get_option, is_front_page,