Last active
April 15, 2019 15:20
-
-
Save seoagentur-hamburg/8938218 to your computer and use it in GitHub Desktop.
Breadcrumbs als Toolbox-Modul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Module Name: Breadcrumbs | |
Description: Erstellt eine Brotkrumen-Navigation [Frontend] | |
Author: Andreas Hecht | |
Author URI: http://hechtmediaarts.com | |
*/ | |
/* Sicherheitsabfrage */ | |
if ( !class_exists('Toolbox') ) { | |
die(); | |
} | |
function the_breadcrumb() { | |
echo '<ul id="crumbs">'; | |
if (!is_home()) { | |
echo '<li><a href="'; | |
echo get_option('home'); | |
echo '">'; | |
echo 'Home'; | |
echo "</a></li>"; | |
if (is_category() || is_single()) { | |
echo '<li>'; | |
the_category(' </li><li> '); | |
if (is_single()) { | |
echo "</li><li>"; | |
the_title(); | |
echo '</li>'; | |
} | |
} elseif (is_page()) { | |
echo '<li>'; | |
echo the_title(); | |
echo '</li>'; | |
} | |
} | |
elseif (is_tag()) {single_tag_title();} | |
elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';} | |
elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';} | |
elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';} | |
elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';} | |
elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';} | |
elseif (is_search()) {echo"<li>Search Results"; echo'</li>';} | |
echo '</ul>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment