• 01-10-2010, 01:55:11
    #1
    bir etiket grubunun son 5 yazısını gösterme kodu nedir arkadaşlar?

    örneğin id numarası 13 olan etiketin son 5 yazısını gösterme kodu?
  • 01-10-2010, 11:39:14
    #2
    <div class="hpfeatured"> 
                            <h3>Son Yazılar</h3> 
                 
    
                 
    <?php $recent = new WP_Query("showposts=5"); while($recent->have_posts()) : $recent->the_post();?> 
    
    
                    <?php if( get_post_meta($post->ID, "resim", true) ): ?> 
                        <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "resim", true); ?>" alt="<?php the_title(); ?>" width="70" height="70"/></a> 
                    <?php else: ?> 
                           <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a> 
                    <?php endif; ?>                 
                    <b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b> 
                    <?php the_content_limit(80, ""); ?> 
                     
                    <div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div> 
                     
                    <?php endwhile; ?> 
    
                 
                     
                </div>
    id numarası 13 olan etiket in son 5 yazısını göstermek için yukarda nasıl bir değişiklik yapmam lazım arkadaşlar lütfen?
  • 01-10-2010, 11:56:57
    #3
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Bunu dene bakalım.

    <div class="hpfeatured"> 
                            <h3>Son Yazılar</h3> 
                 
    
                 
    <?php $recent = new WP_Query(array('tag__and' => array(13),'showposts' => 5)); while($recent->have_posts()) : $recent->the_post();?> 
    
    
                    <?php if( get_post_meta($post->ID, "resim", true) ): ?> 
                        <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "resim", true); ?>" alt="<?php the_title(); ?>" width="70" height="70"/></a> 
                    <?php else: ?> 
                           <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a> 
                    <?php endif; ?>                 
                    <b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b> 
                    <?php //the_content_limit(80, ""); ?> 
                     
                    <div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div> 
                     
                    <?php endwhile; ?> 
    
                 
                     
                </div>
  • 01-10-2010, 12:13:01
    #4
    Usta tam istediğim gibi oldu çok teşekkür ederim
  • 01-10-2010, 12:15:22
    #5
    Bu arada koddaki,

    <?php //the_content_limit(80, ""); ?>
    kısmının başındaki slaşları kaldırmayı unutmuşum. (Fonksiyon bende olmadığı için.) Sende unutma.
  • 01-10-2010, 12:25:53
    #6
    rugzO adlı üyeden alıntı: mesajı görüntüle
    Bu arada koddaki,

    <?php //the_content_limit(80, ""); ?>
    kısmının başındaki slaşları kaldırmayı unutmuşum. (Fonksiyon bende olmadığı için.) Sende unutma.
    hallettim onu sağolasın