Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

Conditional Tag For Home page ONLY


  #1  
Old Jan 14, 2013, 02:58 PM
sober's Avatar
sober
 
121 posts · Oct 2010
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
  #2  
Old Jan 14, 2013, 03:07 PM
juggledad's Avatar
juggledad
 
23,600 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you are want to test a condition, you need the 'if'
HTML Code:
<?php if (is_home()) { echo do_shortcode(‘[layerslider id=”3”]’); } ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Link in the Footer imagineds Post-Kicker, -Byline & -Footer 1 Nov 9, 2011 02:04 PM
HOWTO: add IE css conditional comments byronyasgur Header configuration & styling 2 Apr 26, 2011 03:25 PM
Conditional div background by Page Parent jaxon Atahualpa 3 Wordpress theme 9 May 6, 2010 11:19 AM
Conditional PHP issue MyJourneytoMillions Center area post/pages 6 Feb 10, 2010 04:11 PM


All times are GMT -6. The time now is 12:10 PM.


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