• 29-03-2018, 16:18:12
    #1
    Arkadaşlar merhaba php ile manuel yapılan slider kategorisini verdiğim (koda numarasını yazdığım) numaranın son eklenen yazılarını çekip gösteriyor.
    Fakat nedendir bilmiyorum son eklenen yazı hep 2 tane geliyor. Yani 1. seçimde de 2. seçimde de aynı yazı geliyor. Hep bu şekilde olmuş 3'ten sonrası normal devam ediyor.
    Sebebini anlamadım aşağıda resimlerini ve kodlarını paylaştım nerede hata yaptığım konusunda yarıdmcı olabilir misiniz?





     <div id="banner">
            <div id="anaslayt" class="col-xs-12 col-sm-12">
        <?php query_posts('showposts=10&cat=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a class="slidesjs-slide" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>    
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" /></a>
                    <?php } ?>
                    <div class="yaziarka">
                    <span class="yazi"><?php the_title(); ?></span>
                    </div>
        <?php endwhile; ?>
            </div>
            <div id="sabitbanner" class="pull-right hidden-sm hidden-xs">
            <div class="yatayhaber">
           
                 
        <?php query_posts('showposts=1&cat=1&posts_per_page=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>    
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                    <?php } ?>
                    <span class="yazi pull-left col-md-12"><?php the_title(); ?></span>
    </a>
        <?php endwhile;?>     
            </div>
               
            <?php query_posts('showposts=2&&cat=1&offset=1'); ?>
                
                <?php while (have_posts()) : the_post(); ?>
            <div class="dikeyhaber">
                <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>    
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                <?php } ?>
                <span class="yazi pull-left col-md-12"><?php the_title(); ?></span></a>
    </div>    
                <?php endwhile;?>
                  
    </div>
    </div>
  • 29-03-2018, 16:47:20
    #2
    Kategori Moderatörü
    Hepsini aynı kategoriden çektiğiniz için filtreye göre ilk post hangisiyse onu gösteriyor. Dolayısıyla ilk postu 2. alanda exclude etmeniz gerekiyor. Bunu post__not_in ile yapabilirsiniz.
    https://codex.wordpress.org/Class_Re...age_Parameters
  • 29-03-2018, 17:35:23
    #3
    Böyle bir deneyin.
    <div id="banner">
            <div id="anaslayt" class="col-xs-12 col-sm-12">
        <?php query_posts('showposts=10&cat=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a class="slidesjs-slide" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" /></a>
                    <?php } ?>
                    <div class="yaziarka">
                    <span class="yazi"><?php the_title(); ?></span>
                    </div>
        <?php endwhile; ?>
            </div>
            <div id="sabitbanner" class="pull-right hidden-sm hidden-xs">
            <div class="yatayhaber">
            
                  
        <?php query_posts('showposts=1&cat=1&posts_per_page=1&offset=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                    <?php } ?>
                    <span class="yazi pull-left col-md-12"><?php the_title(); ?></span>
    </a>
        <?php endwhile;?>    
            </div>
                
            <?php query_posts('showposts=2&cat=1&offset=2'); ?>
                
                <?php while (have_posts()) : the_post(); ?>
            <div class="dikeyhaber">
                <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                <?php } ?>
                <span class="yazi pull-left col-md-12"><?php the_title(); ?></span></a>
    </div>  
                <?php endwhile;?>
                  
    </div>
    </div>
  • 29-03-2018, 17:58:25
    #4
    Onur89TR adlı üyeden alıntı: mesajı görüntüle
    Böyle bir deneyin.
    <div id="banner">
            <div id="anaslayt" class="col-xs-12 col-sm-12">
        <?php query_posts('showposts=10&cat=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a class="slidesjs-slide" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" /></a>
                    <?php } ?>
                    <div class="yaziarka">
                    <span class="yazi"><?php the_title(); ?></span>
                    </div>
        <?php endwhile; ?>
            </div>
            <div id="sabitbanner" class="pull-right hidden-sm hidden-xs">
            <div class="yatayhaber">
            
                  
        <?php query_posts('showposts=1&cat=1&posts_per_page=1&offset=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                    <?php } ?>
                    <span class="yazi pull-left col-md-12"><?php the_title(); ?></span>
    </a>
        <?php endwhile;?>    
            </div>
                
            <?php query_posts('showposts=2&cat=1&offset=2'); ?>
                
                <?php while (have_posts()) : the_post(); ?>
            <div class="dikeyhaber">
                <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                <?php } ?>
                <span class="yazi pull-left col-md-12"><?php the_title(); ?></span></a>
    </div>  
                <?php endwhile;?>
                  
    </div>
    </div>
    Hocam elinize sağlık teşekkür ederim ama slider de halen 2 tane şeklinde beliriyor maalesef
  • 29-03-2018, 19:01:05
    #5
    YavuzTR adlı üyeden alıntı: mesajı görüntüle
    Arkadaşlar merhaba php ile manuel yapılan slider kategorisini verdiğim (koda numarasını yazdığım) numaranın son eklenen yazılarını çekip gösteriyor.
    Fakat nedendir bilmiyorum son eklenen yazı hep 2 tane geliyor. Yani 1. seçimde de 2. seçimde de aynı yazı geliyor. Hep bu şekilde olmuş 3'ten sonrası normal devam ediyor.
    Sebebini anlamadım aşağıda resimlerini ve kodlarını paylaştım nerede hata yaptığım konusunda yarıdmcı olabilir misiniz?





     <div id="banner">
            <div id="anaslayt" class="col-xs-12 col-sm-12">
        <?php query_posts('showposts=10&cat=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a class="slidesjs-slide" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>    
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" /></a>
                    <?php } ?>
                    <div class="yaziarka">
                    <span class="yazi"><?php the_title(); ?></span>
                    </div>
        <?php endwhile; ?>
            </div>
            <div id="sabitbanner" class="pull-right hidden-sm hidden-xs">
            <div class="yatayhaber">
           
                 
        <?php query_posts('showposts=1&cat=1&posts_per_page=1'); ?>
            <?php while (have_posts()) : the_post(); ?>
                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                    <?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
                    elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>    
                    <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                    <?php } ?>
                    <span class="yazi pull-left col-md-12"><?php the_title(); ?></span>
    </a>
        <?php endwhile;?>     
            </div>
               
            <?php query_posts('showposts=2&&cat=1&offset=1'); ?>
                
                <?php while (have_posts()) : the_post(); ?>
            <div class="dikeyhaber">
                <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); } 
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>    
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                <?php } ?>
                <span class="yazi pull-left col-md-12"><?php the_title(); ?></span></a>
    </div>    
                <?php endwhile;?>
                  
    </div>
    </div>
    <div id="banner">
        <div id="anaslayt" class="col-xs-12 col-sm-12">
                <?php $cat = new WP_Query(array( 'cat' => '1', 'posts_per_page' => 10)); while($cat->have_posts()) : $cat->the_post();?>
                <a class="slidesjs-slide" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" /></a>
                <?php } ?>
                <div class="yaziarka">
                <span class="yazi"><?php the_title(); ?></span>
                </div>
            <?php endwhile; ?>
            </div>
            
            <div id="sabitbanner" class="pull-right hidden-sm hidden-xs">
            <div class="yatayhaber"> 
                    <?php $cat = new WP_Query(array( 'cat' => '1', 'posts_per_page' => 1, 'offset' => 10)); while($cat->have_posts()) : $cat->the_post();?>
                            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                            <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                            elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                            <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                            <?php } ?>
                            <span class="yazi pull-left col-md-12"><?php the_title(); ?></span>
                </a>
                <?php endwhile;?>    
            </div> 
            
            <?php $cat = new WP_Query(array( 'cat' => '1', 'posts_per_page' => 2, 'offset' => 11)); while($cat->have_posts()) : $cat->the_post();?>
            <div class="dikeyhaber">
                <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                <?php } ?>
                <span class="yazi pull-left col-md-12"><?php the_title(); ?></span></a>
            </div>  
            <?php endwhile;?>      
        </div>
    </div>
  • 29-03-2018, 19:05:03
    #6
    altf4 adlı üyeden alıntı: mesajı görüntüle
    <div id="banner">
        <div id="anaslayt" class="col-xs-12 col-sm-12">
                <?php $cat = new WP_Query(array( 'cat' => '1', 'posts_per_page' => 10)); while($cat->have_posts()) : $cat->the_post();?>
                <a class="slidesjs-slide" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" /></a>
                <?php } ?>
                <div class="yaziarka">
                <span class="yazi"><?php the_title(); ?></span>
                </div>
            <?php endwhile; ?>
            </div>
            
            <div id="sabitbanner" class="pull-right hidden-sm hidden-xs">
            <div class="yatayhaber">
                    <?php $cat = new WP_Query(array( 'cat' => '1', 'posts_per_page' => 1, 'offset' => 10)); while($cat->have_posts()) : $cat->the_post();?>
                            <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                            <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                            elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                            <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                            <?php } ?>
                            <span class="yazi pull-left col-md-12"><?php the_title(); ?></span>
                </a>
                <?php endwhile;?>    
            </div>
            
            <?php $cat = new WP_Query(array( 'cat' => '1', 'posts_per_page' => 2, 'offset' => 11)); while($cat->have_posts()) : $cat->the_post();?>
            <div class="dikeyhaber">
                <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                <?php if(has_post_thumbnail()) { the_post_thumbnail(); }
                elseif( $thumbnail = get_post_meta($post->ID, 'resim', true) ){  ?>  
                <img src ="<?php echo $thumbnail; ?>" alt="<?php the_title(); ?>"  title = "<?php the_title(); ?>" />
                <?php } ?>
                <span class="yazi pull-left col-md-12"><?php the_title(); ?></span></a>
            </div>  
            <?php endwhile;?>      
        </div>
    </div>
    hocam elinize sağlık teşekkür ederim ama bunda da maalesef 2 tane şeklinde çıktı sağ tarafta ki bannerler de kayboldu.
  • 29-03-2018, 19:06:56
    #7
    YavuzTR adlı üyeden alıntı: mesajı görüntüle
    hocam elinize sağlık teşekkür ederim ama bunda da maalesef 2 tane şeklinde çıktı sağ tarafta ki bannerler de kayboldu.
    Mümkün değil lite speed cache falan mı kullanıyorsun
  • 29-03-2018, 19:11:53
    #8
    altf4 adlı üyeden alıntı: mesajı görüntüle
    Mümkün değil lite speed cache falan mı kullanıyorsun
    Hocam herhangi bir cache eklentisi kullanmıyorum ama js dosyamdan dolayı olabilir diye düşünüyorum.
    http://prntscr.com/iy3vgq
    http://prntscr.com/iy3w18