• 11-04-2013, 21:34:59
    #1
    Wordpress'de slider'da görünen resimlerin timthumb ile yeniden boyutlandırılmasını ve resim ne boyutta olursa olsun otomatik olarak belirleyeceğim bir boyutta görünmesini istiyorum.

    Bu konuda araştırma yaptım ama malesef bir kaynak bulamadım.
    Acaba bu konuda bilgi verecek olan var mı? Yani functions ve slider.php dosyalarına ne yazmama gerekiyor yapı olarak?

    Slider.php şu şekilde:
    					<div class="slider">
    					
    
    										<div id="slider4" class="sliderwrapper">
    										
    										<?php 	
    												$query = new WP_Query();
    												$query->query(array('posts_per_page' => 7));
    												if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); 
    										?>
    										
    										<?php $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 endwhile; endif; wp_reset_query(); ?>			
    										</div>
    						
    
    										<div id="paginate-slider4" style="background:white">
    										
    										<?php 	
    												$query = new WP_Query();
    												$query->query(array('posts_per_page' => 7));
    												if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); 
    										?>
    																				<?php $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 endwhile; endif; 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>
    Doğru mu bilmiyorum ama şu kod yerine başka birşey geleceğini düşünüyorum. Slider'da görünen resimler 600x250 olarak görünsün istiyorum.

    Alıntı
    <div class="contentdiv" style="background: url(<?php echo $image_src; ?> ) center left no-repeat" >

    Yardımcı olabilecek varsa yardımlarınızı bekliyorum.
  • 12-04-2013, 22:11:46
    #2
    <div class="contentdiv" style="background: url(<?php echo $image_src; ?> ) center left no-repeat; background-size: 600px 250px" >

    olurmu bilmiyorum ama bi denermisin?
  • 12-04-2013, 23:29:36
    #3
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Temanızda slider varsa, featured image özelliği de vardır muhtemelen. Yazı ekleme sayfasında sağ alttaki bloktan set featured image linkini tıklayıp upload ederseniz, resim otomatik boyutlandırılır.