PHP If Else statement for breadcrumb
Posted: Thu Oct 22, 2009 8:55 am
Hi
I am trying to use a PHP if else statement to display a breadcrumb link on wordpress
The code
If the user is on "/blog" or "/blog/" folder then I only want to display >> BLOG and if they are on anything else inside that folder I want to display the URL they are on and the crumb
>> BLOG >> POST 1
POST 1 is like http://www.blog.com/blog/post-1
I am trying to use a PHP if else statement to display a breadcrumb link on wordpress
The code
Code: Select all
<div class="triple silhouette_break">
<ul>
<li><a href="/">HOME</a> »</li>
<?
$t=$_SERVER['REQUEST_URI'];
if ($t == "/blog/")
?>
<li><a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('name'); ?>" class="current">BLOG</a> »</li>
<?
else
?>
<li><a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('name'); ?>">BLOG</a> »</li>
<li><a href="<?php $t ?>" class="current"><?php wp_title('«', true, 'right'); ?></a></li>
</ul>
</div>
>> BLOG >> POST 1
POST 1 is like http://www.blog.com/blog/post-1