cja2882 Posted March 20, 2013 Share Posted March 20, 2013 (edited) 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 } ?> Edited March 20, 2013 by Zane Quote Link to comment https://forums.phpfreaks.com/topic/275912-conditional-statement-not-working/ Share on other sites More sharing options...
cja2882 Posted March 20, 2013 Author Share Posted March 20, 2013 (edited) 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 } ?> Edited March 20, 2013 by Zane Quote Link to comment https://forums.phpfreaks.com/topic/275912-conditional-statement-not-working/#findComment-1419787 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.