• 01-07-2013, 00:40:35
    #1
    Arkadaşlar wplog teması kullanmaktayım.
    İndex sayfası ve diğer arşiv sayfalarında yazı önünde bulunan resim alanı normalde panelden bir resim ile şenleniyor.
    Ancak, panelden bi resim yüklemediğim de hiç birşey gözükmüyor.

    Ben bu alana sabit (panelden resim yüklemediğimde) gözükecek bir resim nasıl koyabilirim.

    İndex sayfasından görünüm:
  • 01-07-2013, 00:55:43
    #2
    Üyeliği durduruldu
    <?php
    if ( has_post_thumbnail() ) {
        
       // Eğer bir resim atanmışsa bu resmi göster
       the_post_thumbnail();
     
    } else {
     
       // Eğer bir resim atanmamışsa standart bir resim göster
       <img src="resim.jpg" alt="resim" />
     
    }
    ?>
  • 01-07-2013, 00:57:42
    #3
    Karahan güzel açıklamış, fonksiyon olarakta yazabilirim istersen.

    GT-N7100 cihazımdan gönderildi
  • 01-07-2013, 09:55:02
    #4
    Arkadaşlar Teşekkür Ederim yazmışınız
    Tema BU

    Burdan yardımcı olabilir misiniz?
  • 01-07-2013, 13:23:06
    #5
    css ile sabit bir bg vererek de çözüme ulaşabilirsin
  • 01-07-2013, 16:51:42
    #6
    Sorun halen devam etmekte arkadaşlar.

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 16:51:42 -->-> Daha önceki mesaj 16:45:44 --

    by_karahan adlı üyeden alıntı: mesajı görüntüle
    <?php
    if ( has_post_thumbnail() ) {
        
       // Eğer bir resim atanmışsa bu resmi göster
       the_post_thumbnail();
     
    } else {
     
       // Eğer bir resim atanmamışsa standart bir resim göster
       <img src="resim.jpg" alt="resim" />
     
    }
    ?>
    Bu kodu nereye ve nerelerini değiştirerek koymalıyım Hocam?
  • 01-07-2013, 18:41:15
    #7
    index sayfanın resim gösteren kısmının kodlarını paylaşırsan direk yardımcı olabiliriz. Arkadaşların verdikleri kodlar, resmin gösterildiği yer içindir..
  • 01-07-2013, 21:55:45
    #8
    İNDEX SAYFASI
    <?php get_header(); ?>
    <div id="icerik">
    <?php $vid = get_option('kt_vid'); ?>
    <?php $args = array('cat' => $vid, 'paged' => $paged ); ?>
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($args); ?>
    <div id="konular">	
    		<?php if(get_option('kt_twtonay') == 'evet') { include (TEMPLATEPATH . '/twt.php'); } ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="konu">
    <div class="resim">
    <?php $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); if ( has_post_thumbnail() ) { ?>
    <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php bloginfo('template_url'); ?>/timthumb.php?src=<?php echo $image_url[0]; ?>&amp;w=200&amp;h=150&amp;zc=1" alt="<?php the_title(); ?>" width="200" height="150" /></a>
    <?php } else { ?>
    <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_post_meta($post->ID, 'resim',true) ?>" alt="<?php the_title(); ?>" width="200" height="150" /></a>
    <?php } ?>
    </div>
    <h1><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
    <?php echo kt_limit(get_the_excerpt(), 50); ?>
    
    <div class="yazibilgi"><span class="yazar"><?php the_author(); ?></span><span class="kat"><?php the_category(', ') ?></span><span class="yorum"><?php comments_number('0', '1', '%'); ?> Yorum</span><span class="zaman"><?php the_time('j F Y') ?></span><span class="devami"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Devamı..</a></span></div>
    </div>
    <?php endwhile; ?>
    <div class="temizle"></div>
    <?php wp_reset_query(); ?>
    <div class="sayfalama"><?php echo kt_sayfa(); ?></div>
    <?php else : ?>
    		<div class="yok">
    		<h2>Gösterilecek yazı bulunamamıştır.</h2>
    		<p>Bulunduğunuz sayfada yazı bulunmuyor, lütfen arama kutusunu kullanınız.</p>
    		</div>
    		<?php endif; ?>
    <div class="ayirac"></div>
    <div class="medya">
    <?php $video = get_option('kt_video'); ?>
    <?php  $c = 1; $query3 = new WP_Query();$query3->query('showposts=5&cat='. $video .''); ?>
    			<?php while ($query3->have_posts()) : $query3->the_post(); ?>
    <?php if ($c == 1) { ?>
    <div class="baslik"><?php 
    $category = get_the_category(); 
    if($category[0]){
    echo '<a href="'.get_category_link($category[0]->term_id ).'" title="'.$category[0]->cat_name.'">'.$category[0]->cat_name.'</a>';
    }
    ?></div><?php } ?>
    <div class="hobi"><?php $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); if ( has_post_thumbnail() ) { ?>
    <img src="<?php bloginfo('template_url'); ?>/timthumb.php?src=<?php echo $image_url[0]; ?>&amp;w=50&amp;h=50&amp;zc=1" alt="<?php the_title(); ?>" width="50" height="50" />
    <?php } else { ?>
    <img src="<?php echo get_post_meta($post->ID, 'resim',true) ?>" alt="<?php the_title(); ?>" width="50" height="50" />
    <?php } ?>
    <h3><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <span class="zaman"><?php the_time('j F,Y') ?></span></div>
    <?php $c++; endwhile; ?>
    <?php wp_reset_query(); ?>
    <div class="temizle"></div>
    </div>
    <div class="medya">
    <?php $resim = get_option('kt_resim'); ?>
    <?php  $c = 1; $query3 = new WP_Query();$query3->query('showposts=5&cat='. $resim .''); ?>
    			<?php while ($query3->have_posts()) : $query3->the_post(); ?>
    <?php if ($c == 1) { ?>
    <div class="baslik"><?php 
    $category = get_the_category(); 
    if($category[0]){
    echo '<a href="'.get_category_link($category[0]->term_id ).'" title="'.$category[0]->cat_name.'">'.$category[0]->cat_name.'</a>';
    }
    ?></div><?php } ?>
    <div class="hobi"><?php $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); if ( has_post_thumbnail() ) { ?>
    <img src="<?php bloginfo('template_url'); ?>/timthumb.php?src=<?php echo $image_url[0]; ?>&amp;w=50&amp;h=50&amp;zc=1" alt="<?php the_title(); ?>" width="50" height="50" />
    <?php } else { ?>
    <img src="<?php echo get_post_meta($post->ID, 'resim',true) ?>" alt="<?php the_title(); ?>" width="50" height="50" />
    <?php } ?>
    <h3><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <span class="zaman"><?php the_time('j F,Y') ?></span></div>
    <?php $c++; endwhile; ?>
    <?php wp_reset_query(); ?>
    <div class="temizle"></div>
    </div>
    </div>
    </div>
    <?php get_sidebar(); get_footer(); ?>


    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 21:55:45 -->-> Daha önceki mesaj 21:55:15 --

    Tema Adresi http://www.wptemalari.net/wp-content...4%20temasi.rar
  • 01-07-2013, 22:09:22
    #9
    PHP - WORDPRESS - YAZILIM
    Öncelikle temanının thumbnail özelliğinin olması gerekir.

    Bkz ; google


    daha sonra

    index.php içerisinde css ile şekillendirerek düşündüğünüz görünüme yakın bir görünüm hazırlamak için

     <div class="resim">thumb kodu</div>
            <div class="yazi">yazı içeriği</div>

    css Kodu

    .resim {width:125px;height:125px;float:left;   border: 2px solid #000;    padding: 5px;}
    .resim img {width:125px;height:125px;}
    .yazi {float:left;padding-left:10px;width:446px;}
    Kodlarıyla oynarak istediğiniz tarz bişey ortaya çıkarabilirsiniz.

    Denemesini yapmadım ama numaralarla oynayarak istediğiniz sonucu elde edebilirsiniz.

    Bol Şans.