Jump to content

conditional statement not working


cja2882

Recommended Posts

I have tried to run this code in a wordpress widget and it will not work.  What is wrong with it?

 

 

 

 

<?php if ( in_category('Uncategorized')||is_category('Uncategorized') ) { ?>


    <iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=easyfrugal-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B0083PWAPW" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>


<?php } elseif ( in_category('Cooking')||is_category('Cooking') ) { ?>


    <iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=easyfrugal-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B00007IT2P" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>


<?php } elseif ( in_category('Equipment')||is_category('Equipment') ) { ?>


    <a href="http://www.dpbolvw.net/click-5560901-10680533" target="_top">WWE</a><img src="http://www.lduhtrp.net/image-5560901-10680533" width="1" height="1" border="0"/>


<?php } elseif  {?>
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=easyfrugal-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B000EDG598" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>


<?php } ?>
 

 

Link to comment
https://forums.phpfreaks.com/topic/275912-conditional-statement-not-working/
Share on other sites

Fooled with it some more and this is what I have.  It seems to work except the final else statement is not being read.  And instead it gives me the last elseif on all other pages not mentioned in the statement.  How can I fix this?

 

<?php if ( in_category('Uncategorized')||is_category


('Uncategorized') ) { ?>


    <iframe src="http://rcm.amazon.com/e/cm?


lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=


0000FF&t=easyfrugal-


20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B0083


PWAPW" style="width:120px;height:240px;" 


scrolling="no" marginwidth="0" marginheight="0" 


frameborder="0"></iframe>


<?php } elseif ( in_category('Cooking')||is_category


('Cooking') ) { ?>


    <iframe src="http://rcm.amazon.com/e/cm?


lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=


0000FF&t=easyfrugal-


20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B0000


7IT2P" style="width:120px;height:240px;" 


scrolling="no" marginwidth="0" marginheight="0" 


frameborder="0"></iframe>


<?php } elseif ( in_category('Equipment')


||is_category('Equipment') ) { ?>


    <a href="http://www.dpbolvw.net/click-5560901-


10680533" target="_top">WWE</a><img 


src="http://www.lduhtrp.n...560901-10680533" 


width="1" height="1" border="0"/>


<?php } else  {?>
<iframe src="http://rcm.amazon.com/e/cm?


lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=


0000FF&t=easyfrugal-


20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B000E


DG598" style="width:120px;height:240px;" 


scrolling="no" marginwidth="0" marginheight="0" 


frameborder="0"></iframe>


<?php } ?>
 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.