• 06-10-2014, 14:41:48
    #1
    Üyeliği durduruldu
    wordpress blogumda kullanıcının seçmiş olduğu kategoriye ait yazıları listeleme istiyorum

    				<?php query_posts('showposts=100&orderby=date&cat=1'); ?>
    				<?php while (have_posts()) : the_post(); ?>
    bu kod ile hangi kategori seçilirse seçilsin sadece id değeri 1 olan kategori konuları listeleniyor cat=1 komutu yüzünden bu komut yerine nasıl bir komut kullanmalıyım ki, kullanıcının seçtiği kategoriye göre yazılar listelensin
  • 06-10-2014, 16:10:42
    #2
    bu kodlar category.php'de ise şu işini görecektir,
             <?php query_posts('showposts=100&orderby=date'); ?> 
                    <?php while (have_posts()) : the_post(); ?>
  • 06-10-2014, 16:15:53
    #3
    @krmcnyldrm; Arkadaş kodu vermiş

    bende kodları size açayım isterseniz.

    <?php query_posts('showposts=100&orderby=date&cat=1'); ?>
    <?php while (have_posts()) : the_post(); ?>

    showposts=100 - 100 tane yazı göster
    orderby=date - tarihe göre sırala
    cat=1 - idsi 1 olan kategoriden çek

    tam anlamı idsi 1 olan kategoriden 100 tane yazıyı çek ve tarihe göre sırala
  • 06-10-2014, 19:31:16
    #4
    Üyeliği durduruldu
    krmcnyldrm adlı üyeden alıntı: mesajı görüntüle
    bu kodlar category.php'de ise şu işini görecektir,
             <?php query_posts('showposts=100&orderby=date'); ?> 
                    <?php while (have_posts()) : the_post(); ?>
    işimi görmedi bebim category.php şemam şu şekilde

    <?php
    get_header(); ?>
    
    <div style="padding:0 0 0 0;margin:0 0 0 0;" class="col-md-8">
    <div style="padding:0 0 0 0;margin:0 0 0 0;" class="bs-component">
                  <table style="padding:0 0 0 0;margin:0 0 0 0;" class="table table-striped table-hover ">
                    <thead>
                      <tr>
     <th>#</th>
                        <th>Başlık</th>
    <th>Kategori</th>
                        <th>Tarih</th>
    
                        <th>Okunma Sayısı</th>
                      </tr>
                    </thead>
                    <tbody>
    				                <?php query_posts('showposts=100&orderby=date&cat=1'); ?> 
    
                    <?php while (have_posts()) : the_post(); ?>
    				
                      <tr>
      <td><?php the_ID(); ?></td>
                      
                        <td><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></td>
                                  <td><span class="label label-primaryy"><?php the_category('title_li='); ?></span></td>
    
                        <td><span class="label label-default"><?php the_time('j M Y') ?></span></td>
                        <td><span class="label label-primary"><?php echo getPostViews(get_the_ID()); ?></span></td>
                      </tr>
    				<?php endwhile; ?>
                    </tbody>
                  </table> 
    
    
    
    </div>
    </div>
    <?php get_footer(); ?>