show if (conditional tag)

Eksempel med nivo slider

<?php if ( is_front_page() ) {
 if ( function_exists('show_nivo_slider' ) ) { show_nivo_slider(); }
 } ?>

Source: http://wordpress.org/support/topic/plugin-wp-nivo-slider-show-only-on-home-page

En lang række eksempler

Hvis forside er home:

<?php if (is_home()) { ?>
<p>Show this!</p>
<?php } elseif (is_single()) { ?>
<p>Show this instead!</p>
<?php } elseif (is_category()) { ?>
<p>Show something different!</p>
<?php else { ?>
<p>Show this if no conditions are met</p>
<?php } ?>

Vis, med undtagelse af home:

<?php if (is_home()) {
}
else { ?>
<p>Show this everywhere!</p>
<?php } ?>

Source: http://wphacks.com/wordpress-conditional-tags-hack-theme/

Leave a Reply

Your email address will not be published. Required fields are marked *