• 28-03-2016, 15:00:25
    #1
    Son eklenenler resimli ekledim siteme ama resim boyutunu düzenleyemiyorum.

    Resim boyutu 150x150 olsun istiyorum ama farklı boyutlarda geliyor.

    Eklediğim Kodlar.

    functions.php

    add_theme_support( 'post-thumbnails');
    set_post_thumbnail_size( 640,250,true);
    add_image_size('single-post-thumbnail', 640,250 );
    
    /* POPULER YAZILAR */
    function wpb_set_post_views($postID) {
        $count_key = 'wpb_post_views_count';
        $count = get_post_meta($postID, $count_key, true);
        if($count==''){
            $count = 0;
            delete_post_meta($postID, $count_key);
            add_post_meta($postID, $count_key, '0');
        }else{
            $count++;
            update_post_meta($postID, $count_key, $count);
        }
    }
    remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
    /* #POPULER YAZILAR */
    Son Eklenenleri görmek istediğim Yere

    <?php if(function_exists('rps_show')) echorps_show(); ?> 
    	<?php query_posts('showposts=15'); ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<ul>
    			<li>
    				<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    				<?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
    				elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>	
    				<img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
    				<?php } ?>
    				</a>
    				<h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
    			</li>
    		</ul>
    	<?php endwhile;?>
    Resmin 150x150 gelmesi için ne yapmam lazım.
  • 28-03-2016, 18:41:29
    #2
    Adalente adlı üyeden alıntı: mesajı görüntüle
    Son eklenenler resimli ekledim siteme ama resim boyutunu düzenleyemiyorum.

    Resim boyutu 150x150 olsun istiyorum ama farklı boyutlarda geliyor.

    Eklediğim Kodlar.

    functions.php

    add_theme_support( 'post-thumbnails');
    set_post_thumbnail_size( 640,250,true);
    add_image_size('single-post-thumbnail', 640,250 );
    
    /* POPULER YAZILAR */
    function wpb_set_post_views($postID) {
        $count_key = 'wpb_post_views_count';
        $count = get_post_meta($postID, $count_key, true);
        if($count==''){
            $count = 0;
            delete_post_meta($postID, $count_key);
            add_post_meta($postID, $count_key, '0');
        }else{
            $count++;
            update_post_meta($postID, $count_key, $count);
        }
    }
    remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
    /* #POPULER YAZILAR */
    Son Eklenenleri görmek istediğim Yere

    <?php if(function_exists('rps_show')) echorps_show(); ?> 
    	<?php query_posts('showposts=15'); ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<ul>
    			<li>
    				<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    				<?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
    				elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>	
    				<img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
    				<?php } ?>
    				</a>
    				<h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
    			</li>
    		</ul>
    	<?php endwhile;?>
    Resmin 150x150 gelmesi için ne yapmam lazım.
    functions.php de eklenen kodlarınızda 640,250 olan yeri değiştirin
  • 28-03-2016, 18:43:26
    #3
    Timthumb kullanın en iyisi Valla
  • 29-03-2016, 09:55:30
    #4
    Nasıl ayarlarım onu ?
  • 29-03-2016, 10:05:09
    #5
    add_image_size('single-post-thumbnail', 150,150 );
    denermisiniz
  • 29-03-2016, 10:06:21
    #6
    Alıntı
    <?php if(function_exists('rps_show')) echorps_show(); ?>
    <?php query_posts('showposts=15'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <ul>
    <li>
    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){ ?>
    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>" style="width: 150px; height:150px;" title = "<?php the_title(); ?>" />
    <?php } ?>
    </a>
    <h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
    </li>
    </ul>
    <?php endwhile;?>
    Bu şekilde yaptığınızda olacaktır.

    Dipnot: Harici eklentilere gerek yok bu işler için, ThimbThumb gibi sunucuyu yoran eklentileri hiç kullanmanızı önermem.
  • 31-03-2016, 14:04:04
    #7
    FSahin adlı üyeden alıntı: mesajı görüntüle
    Bu şekilde yaptığınızda olacaktır.

    Dipnot: Harici eklentilere gerek yok bu işler için, ThimbThumb gibi sunucuyu yoran eklentileri hiç kullanmanızı önermem.
    Olmadı hocam resimlerin boyutu küçülmedi.