• 12-10-2012, 23:38:43
    #1
    Üyeliği durduruldu
    Merhaba;
    Bir konuda yardıma ihtiyacım var
    Ana sayfada manşet birde son haberler diye bölüm var

    mansettte 6 haber cıkıyor
    son haberler de o 6 haberden sonrası yer alsın istiyorum
    lutfen yardımlarınıza ihtiyacım var

    kodları yazıyorum

    nereyi nasıl duzeltmem gerekir

    Son haberler kısmının kodları


    <div id="gkonu">
     <?php $guncelk = get_option('guncelk'); $gS = get_option('gS');?>
    <?php 
    global $post;
    $myposts = get_posts('category='.$guncelk.'&showposts='.$gS);
    
    // loop throught each one and print to page
    foreach($myposts as $post) :
    	setup_postdata($post);
    ?>
            <div class="konu">
                <div class="gres">
                <?php if ( has_post_thumbnail() ) {  $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 300,200 ), false, '' ); $thumbnailSrc = $src[0]; ?>	
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo bloginfo('template_url'); ?>/thumb/timthumb.php?src=<?php echo  $thumbnailSrc; ?>&amp;w=217&amp;h=120&amp;zc=1" width="217" height="120" alt="<?php the_title(); ?>" />
    </a>
    <?php } else { ?>
    
    <?php $resim = get_post_meta($post->ID,'resim', true);
     
    if($resim != "") {  ?>
     
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<? echo ($resim); ?>" width="217" height="120" alt="<?php the_title(); ?>" /></a>
     
    <?php }else{ ?>
     
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/habermatik.jpg" width="217" height="120" alt="<?php the_title(); ?>" /> </a>
     
    <?php } ?>
     <?php }?>
                
                </div>
                <div class="gbas"><h1><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1></div>
                <div class="gciz"></div>
                <div class="gtar"><?php the_time('d F Y');?>, <?php comments_number('Yorum Yapılmamış', 'Bir Yorum', '% Yorum' );?></div>
            </div>
    <?php 
    //endwhile; 
    endforeach;
    ?>            
        </div>
  • 13-10-2012, 10:13:52
    #2
    offset=6 ekleyin get_posts un icine
  • 13-10-2012, 16:00:54
    #3
    Üyeliği durduruldu
    Kodu tam olarak nasıl ve nereye yazacagımı belirtirmisin
    veya ornek olarak bu kod yerine bunu yaz gibi
    kusura bakma eklemeye calıstım ama hata aldım.
  • 13-10-2012, 18:16:49
    #4
    Bu Satırı
    $myposts = get_posts('category='.$guncelk.'&showposts='.$gS);
    Aşağıdaki satırla değiştirin

    $myposts = get_posts('category='.$guncelk.'&showposts='.$gS.'&offset=6);
  • 14-10-2012, 03:52:01
    #5
    Üyeliği durduruldu
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/saglik          guncelk.php on line 14
    şeklinde bir hata almaya basladım şimdide
  • 14-10-2012, 13:39:38
    #6
    Üyeliği durduruldu
    Şu Wordpress makalesini bi incele eminim anlayacaksındır neyin ne işe yaradığını koduda sen ona göre düzenleyebileceğini düşünüyorum.
  • 14-10-2012, 14:10:43
    #7
    by_milat ın verdiği kod şöyle olacktı :

    Alıntı
    $myposts = get_posts('category='.$guncelk.'&showposts='.$gS.' &offset=6');
  • 14-10-2012, 16:37:34
    #8
    Üyeliği durduruldu
    tsk ederim. sorun cozuldu.
    Gercekten beni buyuk bir dertten kurtardınız