Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Conditional Tag For Home page ONLY (http://forum.bytesforall.com/showthread.php?t=19335)

sober Jan 14, 2013 01:58 PM

Conditional Tag For Home page ONLY
 
Hi

I am using a slider plugin and want a slider to run on the home page (example.com) and not on any other pages. The template code for the slider is
Code:

<?php echo do_shortcode(‘[layerslider id=”3”]’) ?>
and the code I have tried but doesn't work is
Code:

<?php is_home(); ?><?php echo do_shortcode(‘[layerslider id=”3”]’) ?><?php endif; ?>
. The standalone template code works perfect but crashes with the conditional tag. Does anyone have a clue about what the correct code would be ?

I am on WP 3.5 and Ata 3.7.10

juggledad Jan 14, 2013 02:07 PM

If you are want to test a condition, you need the 'if'
HTML Code:

<?php if (is_home()) { echo do_shortcode(‘[layerslider id=”3”]’); } ?>


All times are GMT -6. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.