show featureed image when width >= 1024px
-
Hi, I got everyting working with the if else etc.
Except when I try to check if the width of the ORIGINALLY uploaded ftrd img >= 1024px..
This is what I got…
Featured image = used as background.
<!-- SET BACKGROUND --> <?php $thumb = get_post_meta($post->ID,'_thumbnail_id',false); $thumb = wp_get_attachment_image_src($thumb[0], false); $width = wp_get_attachment_image_src($thumb[1], false); $thumb = $thumb[0];?> <div id="maximage"> <img class="siteBackground" src="<?php if ( has_post_thumbnail() && is_home() != 'true' && is_archive() != 'true' && in_category('discography') != 'true' && $width[1] > '1023' ) { echo $thumb; } else { echo get_bloginfo( 'stylesheet_directory' ) . '/img/bg/rotate.php';} ?>" alt="" /> </div> <!-- #maximage -->
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘show featureed image when width >= 1024px’ is closed to new replies.