ID, "resim", true) ): ?>
" alt=" " align="right" style="width: 50px; height: 50px;"/>
ID, "resim", true) ): ?>
" alt=" " align="right" style="width: 50px; height: 50px;"/>
/********************************************************************
creating thumbnails
********************************************************************/
function show_thumb($width,$height,$crop,$quality) {
global $post;
$custom_field = get_post_meta($post->ID, 'thumb', true);
$attachments = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', 'numberposts' => 1) );
if ($custom_field == true) {
$wp_url = parse_url(get_bloginfo('template_directory'));
$wp_url = $wp_url['path'];
$wp_url_thumb = $wp_url.'/thumbs/'.$custom_field;
print '';
} elseif ($attachments == true) {
foreach($attachments as $id => $attachment) {
$img = wp_get_attachment_image_src($id, 'full');
$img_url = parse_url($img[0]);
$img_url = $img_url['path'];
$wp_url = parse_url(get_bloginfo('template_directory'));
$wp_url = $wp_url['path'];
print '';
}
}
}
/********************************************************************
show thumbnail based on post ID only
********************************************************************/
function ThumbById($postid) {
$custom_field = get_post_meta($postid, 'thumb', true);
$attachments = get_children( array('post_parent' => $postid, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', 'numberposts' => 1) );
if ($custom_field == true) {
$wp_url = parse_url(get_bloginfo('template_directory'));
$wp_url = $wp_url['path'];
$wp_url_thumb = $wp_url.'/thumbs/'.$custom_field;
print '';
} elseif ($attachments == true) {
foreach($attachments as $id => $attachment) {
$img = wp_get_attachment_image_src($id, 'full');
$img_url = parse_url($img[0]);
$img_url = $img_url['path'];
$wp_url = parse_url(get_bloginfo('template_directory'));
$wp_url = $wp_url['path'];
print '';
}
}
}