php - How to show thumbnail on archive pages only? -
i have wordpress/woocommerce website theme displays featured image thumbnail next post title using code:
<?php if ( isset( $woo_options['woo_post_content'] ) && $woo_options['woo_post_content'] != 'content' ) { woo_image( 'width=' . $settings['thumb_w'] . '&height=' . $settings['thumb_h'] . '&class=thumbnail ' . $settings['thumb_align'] ); } ?>
however, display thumbnail on archive pages only, not on homepage. possible modify code checks if current page homepage, and, if is, thumbnail not displayed?
you're looking wordpress conditional tags. codex article explains how content displayed on particular page depending on conditions.
also, question title contradicts question description. want thumbnails on (a) archive pages or on (b) pages except homepage?
while jeroen has answered case (b), i'd expand answer case (a).
check if on archive page using is_archive() , display thumbnail.
if (is_archive()) { if ( isset( $woo_options['woo_post_content'] ) && $woo_options['woo_post_content'] != 'content' ) { woo_image( 'width=' . $settings['thumb_w'] . '&height=' . $settings['thumb_h'] . '&class=thumbnail ' . $settings['thumb_align'] ); } }
Comments
Post a Comment