Code: if($width != '' || $height != ''){ if (get_the_post_thumbnail( $post->ID, array($width,$height),"" ) == '') { $ftrdimg = '<img src="'.get_template_directory_uri().'/images/slideshow/noftrdimg-1006x250.jpg" />'; } else { $ftrdimg = get_the_post_thumbnail( $post->ID, array($width,$height),"class={$reflect}" ); } } else { if (get_the_post_thumbnail( $post->ID, array(756,250),"" ) == '') { $ftrdimg = '<img src="'.get_template_directory_uri().'/images/slideshow/noftrdimg.jpg" />'; } else { $ftrdimg = get_the_post_thumbnail( $post->ID, array(756,250),"class={$reflect}" ); } } $tmp .=' <a class="reflect" href="'.$url.'">'.$ftrdimg.'</a>'. chr(13); Here is just a little piece of what I got. It is a slider on the front page of my wordpress site. When there is a post with a featured picture it picks it and if not there is just a picture that says no picture on this post. The problem I am having is that when there is a picture that is small it is showing up left justified in the viewer slider thing. If it is a large picture no problem it takes up the whole slider if not its left justified. I am just trying to get these pictures to be centered in the viewer. Is this possible with what I have here? If there is anymore info you need let me know. Just getting back into internet marketing again. This is my first post after almost 3 years as a member but recently really liking warrior forum better than that other forum that many are probably familiar with. Thanks
Wordpress or Php issue not sure
14
Code:
if($width != '' || $height != ''){
if (get_the_post_thumbnail( $post->ID, array($width,$height),"" ) == '') { $ftrdimg = '<img src="'.get_template_directory_uri().'/images/slideshow/noftrdimg-1006x250.jpg" />'; } else { $ftrdimg = get_the_post_thumbnail( $post->ID, array($width,$height),"class={$reflect}" ); }
} else {
if (get_the_post_thumbnail( $post->ID, array(756,250),"" ) == '') { $ftrdimg = '<img src="'.get_template_directory_uri().'/images/slideshow/noftrdimg.jpg" />'; } else { $ftrdimg = get_the_post_thumbnail( $post->ID, array(756,250),"class={$reflect}" ); }
}
$tmp .=' <a class="reflect" href="'.$url.'">'.$ftrdimg.'</a>'. chr(13); Thanks
- lazypuppy
- seopress
- [1] reply
- lazypuppy
- footballbob06
- seopress
- footballbob06
- seopress
- footballbob06
- seopress
- [1] reply
- lazypuppy
- footballbob06
- jaasmit
Next Topics on Trending Feed
-
14