Conditional string comparison failing for basename/slug
I am trying to display a particular block of html for one page in particular. I have created a conditional statement that compares the basename of the page to my string.
?php if ( has_tag( 'Sponsor' ) basename( get_permalink() != 'sponsor-one') ) : // show sponsor's footer if applicable ?
div class="sponsor-footer ?php echo basename( get_permalink() ); ?"
pOur text here/p
/div
?php elseif ( has_tag( 'Sponsor' ) basename( get_permalink() == 'sponsor-one') ) : // show sponsor one's footer if applicable ?
div class="sponsor-footer ?php echo basename( get_permalink() ); ?"
pOur other text here/p
/div
?php endif; ?
It always outputs the first block of code even when the slug is "sponsor-one".
If I var_dump( basename( get_permalink() ) );
I get string(11) "sponsor-one"
, so why is it saying that the basename is not equal to "sponsor-one"?
Topic comparison php templates Wordpress
Category Web