0.9*$imgl[1]||$y>0.9*$imgl[2]){$img=$imgl;$imgl= wp_get_attachment_image_src( $img_id,'large' );} if ($x>0.9*$imgl[1]||$y>0.9*$imgl[2]){$img=$imgl;$imgl= wp_get_attachment_image_src( $img_id,'full' );} if ($x>0.9*$imgl[1]||$y>0.9*$imgl[2]){$img=$imgl;} } } if ($img){ $src=$img[0]; $width=$img[1]; $height=$img[2]; $yy=@($x*$height/$width); $xx=@($y*$width/$height); $ml=$mt=''; if ($x<$xx){$ml='margin-left: -'.(($xx-$x)/2).'px';} elseif ($y<$yy){$mt='margin-top: -'.(($yy-$y)/2).'px';} $style=($ml||$mt)?"style='$mt$ml'":''; } }elseif (!empty($imgurl)){ $image=@getimagesize($imgurl); if ($image){ $xx=$image[1]*$x/$y; $yy=$image[0]*$y/$x; if ($x/$y>$image[0]/$image[1]){$height=$yy;$width=$image[0];} else {$width=$xx;$height=$image[1];} } else {$width=$x;$height=$y;} $src=get_bloginfo('template_directory').'/includes/timthumb.php?src='.$imgurl.'&w='.floor($width).'&h='.floor($height).'&zc=1'; } if (!empty($src)){ $size=($x/$y < @($width/$height))?"height='$y'":"width='$x'"; $src= "".get_the_title().""; //set image replacement } elseif($not==2){ if ($featured&&$fnotimg) $src= "".get_the_title().""; elseif(!$featured&&$notimg) $src= "".get_the_title().""; } elseif($not==1){ $src= ''.get_the_title().''; } else {return;} return '
'.$src.'
'; } /** * Function to print front page style * */ function itx_front_styles(){ extract(itx_get_option('front')); $postwidth=($type=='traditional')?100:100/$column; echo" .posts{width:$postwidth%;} .posts .meta{width:{$thumbx}px;} .itx-thumb .cont{width:{$thumbx}px;height:{$thumby}px;} .featured .meta{width:{$featuredx}px;} .itx-featured .cont{width:{$featuredx}px;height:{$featuredy}px;}"; } /** * Function to change excerpt more to custom text. * */ function itx_excerpt_more() { $more=itx_get_option('front','excerpt_more'); if ($more) return ' '.$more.''; } add_filter('excerpt_more', 'itx_excerpt_more'); /** * Function print the meta value * * @param string The position/location of the meta. */ function itx_meta($pos,$class=''){ $meta=itx_get_option('front','meta'); if (!empty($meta[$pos])){ echo "
"; if (has_filter('itx_meta_'.$meta[$pos])) apply_filters ('itx_meta_'.$meta[$pos]); else { switch ($meta[$pos]){ case ('date') : echo ''; the_time(get_option('date_format')); break; case ('category') : echo ''; $c=get_the_category(); echo $c[0]->cat_name; break; case ('author') : echo ''; the_author_link(); break; case ('commentcount') : echo ''; echo ''; comments_number('0','1', '%'); echo ''; break; } } echo '
'; } } /** * Function check wether meta is shown. * * @param string The position/location of the meta. * @return bool meta is active. */ function itx_is_active_meta($pos){ $meta=itx_get_option('front','meta'); if (!empty($meta[$pos])) return true; } ?>