Freelance Web Designer in Dubai & SEO Expert in Kerala
01 / 01

WordPress Breadcrumbs Without Plugin

You can create a WordPress website breadcrumbs without any plugin. You can do it a WordPress the_breadcrumb() function.

 

<?PHP
function the_breadcrumb() {
echo '&lt;ul id="crumbs"&gt;';
if (!is_home()) {
echo '&lt;li&gt;&lt;a href="';
echo get_option('home');
echo '"&gt;';
echo 'Home';
echo "&lt;/a&gt;&lt;/li&gt;";
if (is_category() || is_single()) {
echo '&lt;li&gt;';
the_category(' &lt;/li&gt;&lt;li&gt; ');
if (is_single()) {
echo "&lt;/li&gt;&lt;li&gt;";
the_title();
echo '&lt;/li&gt;';
}
} elseif (is_page()) {
echo '&lt;li&gt;';
echo the_title();
echo '&lt;/li&gt;';
}
}
elseif (is_tag()) {single_tag_title();}
elseif (is_day()) {echo"&lt;li&gt;Archive for "; the_time('F jS, Y'); echo'&lt;/li&gt;';}
elseif (is_month()) {echo"&lt;li&gt;Archive for "; the_time('F, Y'); echo'&lt;/li&gt;';}
elseif (is_year()) {echo"&lt;li&gt;Archive for "; the_time('Y'); echo'&lt;/li&gt;';}
elseif (is_author()) {echo"&lt;li&gt;Author Archive"; echo'&lt;/li&gt;';}
elseif (isset($_GET['paged']) &amp;&amp; !empty($_GET['paged'])) {echo "&lt;li&gt;Blog Archives"; echo'&lt;/li&gt;';}
elseif (is_search()) {echo"&lt;li&gt;Search Results"; echo'&lt;/li&gt;';}
echo '&lt;/ul&gt;';
}
by anvar
Published : May , 17

Post a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WhatsApp Logo Chat
design specialist