• 31-08-2013, 19:36:40
    #1
    	<div class="res">
    	<h2>Kategori İsmi</h2>
                <ul>
               
                    <?php query_posts('showposts=5&orderby=date&cat=1'); ?>
    				  <li>
                        <div class="resimgoster"></div>
                    </li> 
    <?php while (have_posts()) : the_post(); ?>
      
    <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
                         <img src="<?php echo get_post_meta($post->ID, "resim", true); ?>" alt="<?php the_title(); ?>" class="aktifResim"/>
                        </a>
    					</li>
    <?php endwhile; ?>
    
    
                </ul>
            </div>
    kodda sadece ilk resme class="aktifResim" uygulamak istiyorum. nasıl yapabilirim.


    yardım edecek biri var mı ?
  • 31-08-2013, 21:08:51
    #2
    YilmazHosting adlı üyeden alıntı: mesajı görüntüle
    	<div class="res">
    	<h2>Kategori İsmi</h2>
                <ul>
               
                    <?php query_posts('showposts=5&orderby=date&cat=1'); ?>
    				  <li>
                        <div class="resimgoster"></div>
                    </li> 
    <?php while (have_posts()) : the_post(); ?>
      
    <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
                         <img src="<?php echo get_post_meta($post->ID, "resim", true); ?>" alt="<?php the_title(); ?>" class="aktifResim"/>
                        </a>
    					</li>
    <?php endwhile; ?>
    
    
                </ul>
            </div>
    kodda sadece ilk resme class="aktifResim" uygulamak istiyorum. nasıl yapabilirim.


    yardım edecek biri var mı ?
    Denermisiniz :

    <div class="res">
    	<h2>Kategori İsmi</h2>
                <ul>
               
                    <?php $i=0; query_posts('showposts=5&orderby=date&cat=1'); ?>
    				  <li>
                        <div class="resimgoster"></div>
                    </li> 
    <?php while (have_posts()) : the_post(); ?>
      
    <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
                         <img src="<?php echo get_post_meta($post->ID, "resim", true); ?>" alt="<?php the_title(); ?>" <?php if($i==1){?>class="aktifResim" <?php } ?>/>
                        </a>
    					</li>
    <?php $i++; endwhile; ?>
    
    
                </ul>
            </div>
  • 31-08-2013, 21:57:45
    #3
    teşekkürler sorun çözüldü. sizin kodunuzu denemedim ama ytine de teşekkürler ilginize