Last active
June 12, 2017 14:16
-
-
Save ScarletPonytail/70bc96dda1ccd310cfd264f2f78f02f0 to your computer and use it in GitHub Desktop.
Wordpress - If-Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Using page name --> | |
<?php | |
if (is_page( 'Wine Investment')) { | |
get_template_part( 'carousel-wine-investment' ); | |
} | |
?> | |
<!-- Using page id --> | |
<?php | |
if (is_page( 42 )) { | |
get_template_part( 'carousel-wine-investment' ); | |
} | |
?> | |
<!-- Alternative syntax - Using page name --> | |
<?php if (is_page( 'Hearing Aids & Accessories') ):?> | |
<div class="slider"> | |
<?php echo do_shortcode('[soliloquy id="437"]'); ?> | |
</div> | |
<?php endif; ?> | |
<!-- Alternative syntax - Using page id --> | |
<?php if (is_page( 42 )):?> | |
<div class="slider"> | |
<?php echo do_shortcode('[soliloquy id="437"]'); ?> | |
</div> | |
<?php endif; ?> | |
<?php | |
if ( is_front_page() && is_home() ) { | |
// Default homepage | |
} elseif ( is_front_page() ) { | |
// static homepage | |
} elseif ( is_home() ) { | |
// blog page | |
} else { | |
//everything else | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment