Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

Conditional Tag For Home page ONLY

Old Jan 14, 2013, 01:58 PM
sober's Avatar
121 posts · Oct 2010

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
<?php echo do_shortcode([layerslider id=3]) ?>
and the code I have tried but doesn't work is
<?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
Old Jan 14, 2013, 02:07 PM
juggledad's Avatar
23,765 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


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 01:04 PM
HOWTO: add IE css conditional comments byronyasgur Header configuration & styling 2 Apr 26, 2011 02:25 PM
Conditional div background by Page Parent jaxon Atahualpa 3 Wordpress theme 9 May 6, 2010 10:19 AM
Conditional PHP issue MyJourneytoMillions Center area post/pages 6 Feb 10, 2010 03:11 PM

All times are GMT -6. The time now is 11:34 AM.

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