PHP If Else statement for breadcrumb


Posted on 16th Feb 2014 07:03 pm by admin

Hi

I am trying to use a PHP if else statement to display a breadcrumb link on wordpress

The code

Line number On/Off | Expand/Contract <div class="triple silhouette_break"> <ul> <li><a href="/">HOME</a> &raquo;</li><? $t=$_SERVER['REQUEST_URI']; if ($t == "/blog/")?><li><a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('name'); ?>" class="current">BLOG</a> &raquo;</li><? else ?> <li><a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('name'); ?>">BLOG</a> &raquo;</li> <li><a href="<?php $t ?>" class="current"><?php wp_title('&laquo;', true, 'right'); ?></a></li> </ul> </div>

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

No comments posted yet

Your Answer:

Login to answer
260 Like 10 Dislike
Previous forums Next forums
Other forums

New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan

Send current URL in URL with a $_GET variable problem.
Hello community,

I have created a function that gets the current variable of a page, example:

help with insert
Hi there,

I am trying to insert some data into a database, but for some reason, it is not ins

controlling/creating accounts with privileges
hi all,
i'm trying to figure out how i can create/control account with privileges, for instance a

Class not found error
I am getting Class 'index' not found in Eval function:

//write config

$pat

Help with some dates
I have a list of dates in an array:

$mondays = array(
strtotime("October 12, 2009

CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related codi

pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help

getAlexaRank($url) function not working
I have made a function to get alexa rank
the site is here: http://mytestsite.rack111.com/1

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash