• 12-08-2012, 22:14:32
    #10
    future adlı üyeden alıntı: mesajı görüntüle
    Hocam resim adlı özel alandan değil de, yazı içindeki ilk resim otomatik olarak slider'da çıkıyor. Şuan belirlediğimiz kategoriden çekiyor fakat slider'da resimler görünmüyor.
    O bölüme ne yazmam gerekiyor acaba.
                        <div class="slider">
                    <div id="slider4" class="sliderwrapper">
                     <?php $postslist = get_posts('numberposts=5&category=1'); foreach ($postslist as $post) : setup_postdata($post); 
    				 $id =$post->ID;
        $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
        $pattern = '!<img.*?src="(.*?)"!';
        preg_match_all($pattern, $the_content, $matches);
        $image_src = $matches['1'][0];?>                                        
                    <div class="contentdiv" style="background: url(<?php echo $image_src; ?>) center left no-repeat">
                    <div class="conttitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
                    </div>
    				 <?php endforeach; ?> 
    				 				                <?php wp_reset_query(); ?>     
                    </div>
                    <div id="paginate-slider4" style="background:white">
                      <?php $postslist = get_posts('numberposts=5&category=2'); foreach ($postslist as $post) : setup_postdata($post); $id =$post->ID;
        $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
        $pattern = '!<img.*?src="(.*?)"!';
        preg_match_all($pattern, $the_content, $matches);
        $image_src2 = $matches['1'][0]; 
    				  ?>                                        
                    <a href="<?php the_permalink(); ?>" class="toc"><img alt="<?php the_title(); ?>" src="<?php echo $image_src2; ?>" /></a> 
    				 <?php endforeach; ?> 
    				                                                         <?php wp_reset_query(); ?>     
                    </div>
                    <script type="text/javascript">
                        featuredcontentslider.init({
                    id: "slider4", 
                    contentsource: ["inline", ""], 
                    toc: "markup", 
                    nextprev: ["", "Next"],  
                    revealtype: "mouseover",  
                    enablefade: [true, 0.1],  
                    autorotate: [true, 4000],  
                    onChange: function(previndex, curindex){  
                    }
                    })
                    </script>
                        </div>
    bu şekilde dener misiniz? Mutlaka yedek alın.

    Not: kodda ufak bi' hata yapmıştım düzelttim. Şu an ki halini kullanırsanız iyi olur.
  • 12-08-2012, 22:19:35
    #11
    Çok teşekkür ederim hocam şuanda işe yaradı, sorun yok gibi görünüyor.
  • 12-08-2012, 22:26:02
    #12
    future adlı üyeden alıntı: mesajı görüntüle
    Çok teşekkür ederim hocam şuanda işe yaradı, sorun yok gibi görünüyor.
    rica ederim. iyi çalışmalar.