WordPress Snippet – Breadcrumb without plugin

WordPress Theme by defauly doesnt provide an option to through breadcrumb, however there are lot of plugins allow us to do the same.
But for a simple PHP Function, it’s not a good idea to use a wordpress plugin. The following code is a simple PHP Function enable you to create a breadcrumb like professional websites.

Use this code in Functions.php

[php]function the_breadcrumb_without_plugin() {
echo ‘<ul class="breadcrumbs">’;
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>’;
}[/php]

Use this code in Required Theme Section like header.php

[php]
<?php the_breadcrumb_without_plugin(); ?>
[/php]

Read More

CSS Tips – How to Style Placeholder text?

Lot of designers are using placeholder on form elements. Few designers try to design Form in such a way that they will either show and hide for screen readers. Few others use Floating labels, If you want to know more about Floating Labels please read this

CSS

[css]
::-webkit-input-placeholder {
color: red;
}

::-moz-placeholder {
color: green;
}

:-ms-input-placeholder {
color: blue;
}

[/css]

HTML

[html]
<input type="text" placeholder="Enter your Name here"/>
[/html]

Additional note:
The :-moz-placeholder pseudo-class is deprecated in Firefox 19.

For older version of IE to support the placeholder, you may need to use some javascript solution.

Read More