• 25-05-2013, 00:54:40
    #1
    Bir tema üzerinde oynama yapıyorum fakat bir şeyi çözemedim.

    archive.php dosyasında şöyle bir kod var:

    <?php $recent = new WP_Query("showposts=20&cat=1"); while($recent->have_posts()) :
    Bu koddan ötürü bütün kategorilerde 1 numaralı kategoriye ait yazılar çıkıyor.

    Bu kodda nasıl bir değişiklik yapmam gerekiyor, her kategorinin kendine ait yazılarının çıkabilmesi için?
  • 25-05-2013, 01:02:44
    #2
    mre
    Kimlik doğrulama veya yönetimden onay bekliyor.
    onu komple kaldir bunu koy

    Alıntı
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    en altta da eger <?php endif; ?> yoksa endwhile in yanina bunuda ekle
  • 25-05-2013, 16:47:56
    #3
    mre adlı üyeden alıntı: mesajı görüntüle
    onu komple kaldir bunu koy



    en altta da eger <?php endif; ?> yoksa endwhile in yanina bunuda ekle
    Bu çözüm olmadı maalesef.
  • 25-05-2013, 16:51:02
    #4
    sayfayi burada paylasirmisin
  • 25-05-2013, 16:51:03
    #5
    Kimlik doğrulama veya yönetimden onay bekliyor.
    &cat=1 silmen yeterlidir.
  • 25-05-2013, 17:00:53
    #6
    Ergün adlı üyeden alıntı: mesajı görüntüle
    &cat=1 silmen yeterlidir.
    O şekilde de olmadı.

    Sayfa:

    <?php
    
    /**
    
     * @package WordPress
    
     * @subpackage Default_Theme
    
     */
    
    
    
    get_header();
    
    ?>
    
    <div id="sol">
    
    
    
    		<div class="solbaslikana"><div style="float: left;margin-top: 6px;">Haberler</div> <div style="float: left;margin-left: 330px; margin-top: 8px;"><a class="solbaslinkana"> 
    
    </a></div></div>  
    
    
    
    <div class="solbaslikortaana">
    
    
    <?php $recent = new WP_Query("showposts=20&cat=1"); while($recent->have_posts()) :
    
    $recent->the_post();?>	
    				  
    
    
    
    
    
    <div class="haber"> <?php if( get_post_meta($post->ID, "Thumbnail", true) ): ?>    				    
    
    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>    				
    
    <?php else: ?>    				   	
    
    <a href="<?php the_permalink() ?>" rel="bookmark">
    
    <img src="<?php bloginfo('template_url'); ?>/images/kirita.png" alt="<?php the_title(); ?>" /></a>    				
    
    <?php endif; ?>	 <h2><a href="<?php the_permalink() ?>" rel="bookmark">   <?php if (strlen($post->post_title) > 50) {
    
    echo mb_substr(the_title($before = '', $after = '', FALSE), 0, 50) . '...'; } else {
    
    the_title();
    
    } ?> </a></h2> 
    
    <div class="haberkonu"><a href="<?php the_permalink() ?>"><?php the_content_limit(70, ""); ?></a> </div> </div>    <?php endwhile; ?>
    
    </div> <div class="solbaslikaltana"></div>  
    
    <div class="solbaslikalt"></div>
    
    <?php wp_pagenavi(); ?>
    
    </div>                                
    
    
    
    <?php get_sidebar(); ?> 
    
     
    
    
    
    
    
    
    
    
    
    
    
     <?php get_footer(); ?>
    Aynı zamanda bu sayfada tek kategori olduğu için Haberler başlığı da var, onun yerine de her kategorinin kendi ismini getirtmeyi sağlamalıyız.
  • 25-05-2013, 17:19:10
    #7
     <?php $recent = new WP_Query("showposts=20&cat=1"); while($recent->have_posts()) :
     
    $recent->the_post();?>
    asagidaki ile degistirip denermisin

    <?php $recent; while($recent->have_posts()) : $recent->the_post();?>
  • 25-05-2013, 17:32:32
    #8
    Ergün adlı üyeden alıntı: mesajı görüntüle
     <?php $recent = new WP_Query("showposts=20&cat=1"); while($recent->have_posts()) :
     
    $recent->the_post();?>
    asagidaki ile degistirip denermisin

    <?php $recent; while($recent->have_posts()) : $recent->the_post();?>
    Olmadı.

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 17:32:32 -->-> Daha önceki mesaj 17:30:42 --

    mre adlı üyeden alıntı: mesajı görüntüle
    sayfayi burada paylasirmisin
    Paylaştım.
  • 25-05-2013, 17:44:43
    #9
    Alıntı
    <?php

    /**

    * @package WordPress

    * @subpackage Default_Theme

    */



    get_header();

    ?>

    <div id="sol">



    <div class="solbaslikana"><div style="float: left;margin-top: 6px;">Haberler</div> <div style="float: left;margin-left: 330px; margin-top: 8px;"><a class="solbaslinkana">

    </a></div></div>



    <div class="solbaslikortaana">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>






    <div class="haber"> <?php if( get_post_meta($post->ID, "Thumbnail", true) ): ?>

    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>

    <?php else: ?>

    <a href="<?php the_permalink() ?>" rel="bookmark">

    <img src="<?php bloginfo('template_url'); ?>/images/kirita.png" alt="<?php the_title(); ?>" /></a>

    <?php endif; ?> <h2><a href="<?php the_permalink() ?>" rel="bookmark"> <?php if (strlen($post->post_title) > 50) {

    echo mb_substr(the_title($before = '', $after = '', FALSE), 0, 50) . '...'; } else {

    the_title();

    } ?> </a></h2>

    <div class="haberkonu"><a href="<?php the_permalink() ?>"><?php the_content_limit(70, ""); ?></a> </div> </div> <?php endwhile; endif; ?>

    </div> <div class="solbaslikaltana"></div>

    <div class="solbaslikalt"></div>

    <?php wp_pagenavi(); ?>

    </div>



    <?php get_sidebar(); ?>













    <?php get_footer(); ?>

    dedigim sekilde yaptim denedim calisiyor