Friday, December 11, 2009

12/12 WP Switch

Please add updates@feedmyinbox.com to your address book to make sure you receive these messages in the future.
WP Switch - Just another WordPress weblog Feed My Inbox

Add Breadcrumbs to WordPress Without a Plugin
December 11, 2009 at 6:01 am

Breadcrumbs are a great way to give people a perspective of where they are on your site. In this post I will explain how to add breadcrumbs to Wordpress without using a plugin. Adding this feature will also help the search engine spiders to find the structure of your site and decrease the time it takes to index a single page. A lot of wordpress theme developers like to use as few plugins as possible and this code will help you accomplish that.

 <div class="breadcrumbs"> <?php function breadcrumbs() {     $theFullUrl = $_SERVER["REQUEST_URI"];     $urlArray=explode("/",$theFullUrl);     echo 'You Are Here: <a href="/">Home</a>';     while (list($j,$text) = each($urlArray)) {         $dir=";         if ($j > 1) {             $i=1;             while ($i < $j) {                 $dir .= '/' . $urlArray[$i];                 $text = $urlArray[$i];                 $i++;             }             if($j < count($urlArray)-1) echo ' &raquo; <a href="'.$dir.'">' . str_replace("-", " ", $text) . '</a>';         }     }     echo wp_title(); } breadcrumbs(); ?> </div> 

To include Breadcrumbs in your theme simply place the following where you need them:

 <?php include ( TEMPLATEPATH . '/breadcrumbs.php'); ?> 

You can do the same by creating a function in your functions.php file and then calling the function in your theme.

Using the css class “breadcrumbs” you can style the results to easily blend in with your current theme.

.via { egrace creative }

Related posts:

  1. Adding a search bar to the NextGEN Gallery Plugin
  2. How to Disable HTML in Wordpress Comments Area
  3. Display The Number Of Your Twitter Followers in Wordpress

 

This email was sent to asif2bd+wpnewspost@gmail.comManage Your Account
Don't want to receive this feed any longer? Unsubscribe here.

No comments:

Post a Comment