• 05-05-2014, 19:56:39
    #1
    merhaba arkadaşlar .if döngüsü ile ufak bir sorunum var ?
    if döngüsü yaptığğımda birden fazla yazı yazdırıyor. bunun sebebi nedir ?.
    kodda sorun yok acaba kodları yerlerinde bir problem olabilir?.
    sonuc olarak bu görüntü sağlıyor :

    kullandığım php kodum
    <?php if (function_exists('get_highest_score_category')): ?>
    
            <?php get_highest_score_category(81); ?>
    
    <?php endif; ?>
    index.php dosyadaki kodlarım :
    <?php query_posts('showposts=5&orderby=date&cat=81'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url(); ?>
    <div class="kOrta1"><div class="oNo">1.</div><div class="oTip"><img src="<?php bloginfo('template_url'); ?>/images/metin2kucuk.png" /></div><div class="oServer">
    <?php if (function_exists('get_highest_score_category')): ?>
    <?php get_highest_score_category(81); ?>
    <?php endif; ?></div><div class="oDurum"><img src="<?php bloginfo('template_url'); ?>/images/<?php echo get_post_meta($post->ID, "metin_selectt", true); ?>.png" /></div><div class="oZorluk"><?php echo get_post_meta($post->ID, "metin_select", true); ?></div><div class="temizle"></div></div>
    <?php endwhile; ?>
    </div></div></div></div>
  • 11-05-2014, 17:24:31
    #2
    konuma cevap verecek arkadaşlar var mı ?.
  • 15-05-2014, 13:49:46
    #3
    endwhile ile endif yerlerini degiştirsen..
  • 15-05-2014, 16:08:34
    #4
    Alıntı
    <?php if (function_exists('get_highest_score_category')): ?>

    <?php get_highest_score_category(); ?>

    <?php endif; ?>
    Bu kodu çalıştırdığınızda tek bir yazı mı geliyor yoksa daha fazla mı hocam?
  • 15-05-2014, 18:05:59
    #5
    Kimlik doğrulama veya yönetimden onay bekliyor.
    teknik olarak if döngü değil, condition'dır, yani şart işlecidir. while döngüdür.

    yazının birden fazla çıkması while ile alakalı bir durum diye tahmin ediyorum.

    sorgunu kontrol eder misin ?