نیازمند اسلایدر مطالب یا کد

alihesari

کاربر عضو
از افزونه Dynamic Content Gallery برای اسلایدر مطالب میخواستم استفاده کنم ولی وقت راه اندازیش قالب به هم میریزه. اسلایدر رو میخوام در سایدبار قرار بدم و مطالب یک یا چند دسته رو نمایش بده. دوستان اگر آموزشی برای ساخت چنین اسلایدری و یا معرفی افزونه ای مناسب سراغ دارن لطف کنن.


 

Mohammad

مدیر انجمن
پرسنل مدیریت
پیشنهاد میکنم از افزونه های خارجی استفاده نکنید و یا در صورت استفاده باید css رو بر اساس سایت های راست چین تغییر بدید.

میتونید از اسکریپت های اسلایدر استفاده کنید و به صورت دینامیک با کوئری های وردپرس در بیارید. بحث مهم عدم تداخل در جی کوئری سایت و دیگر بخش ها با این اسلایدر شماست

 

alihesari

کاربر عضو
من از اسلایدر زیر میخوام استفاده کنم ولی هرکار میکنم پست ها رو نمایش نمیده لطفا کدها رو ببینید اگه مشکلی داره راهنمایی کنید


کد:
[COLOR=#000000]<?php query_posts('cat=2&showposts=3'); ?>[/COLOR]<?php if ( have_posts() ) : ?>

<div class="slider-wrap">
    <ul class="bxslider">
    <?php  while ( have_posts() ) : the_post(); ?>
    <li <?php post_class(); ?> id="post-<?php the_ID(); ?>">

        <div class="blog-featured"> 
		<a href="<?php the_permalink(); ?>" rel="bookmark" > 
			<img src="<?php bloginfo('stylesheet_directory'); ?>/scripts/timthumb.php?src=<?php 
				$image_id = get_post_thumbnail_id();
				$image_url = wp_get_attachment_image_src($image_id,'full');
				echo $image_url[0]; 
				?>&h=230&w=715&zc=1&q=100&c=1&a=t"
			alt="<?php the_title(); ?>" 
	    		/>  
		</a>
	</div> <!-- END Blog Featured Image --> 

	<div class="blog-summary alpha60">
		<?php the_excerpt(); ?><a href='<?php the_permalink(); ?>' rel="bookmark" >Read More >> </a>
	</div> <!-- END Blog Summary -->

	    </li>
<?php endwhile; ?>
	</ul><!-- END Blog Roll --> 
</div> <!-- END slider wrap -->

<?php else : ?>
	<h2 class="center">Not Found</h2>
	<p class="center">Sorry, but you are looking for something that isn't here.</p>
	<?php 
		endif;
		wp_reset_postdata(); [COLOR=#000000]	?>[/COLOR]
کد های css:


کد:
[COLOR=#000000].slider-wrap { [/COLOR]  margin:0 auto; 
	width:665px; 
	height:275px; 
	overflow:hidden;
}
.bxslider { 
	width:665px; 
	height:275px;
}
.alpha60 {
  /* Fallback for web browsers that doesn't support RGBa */
	background: rgb(0, 0, 0);
	/* RGBa with 0.6 opacity */
	background: rgba(0, 0, 0, 0.6);
	/* For IE 5.5 - 7*/
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
	/* For IE 8*/
	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
}
.blog-featured { 
	width:665px; 
	height:230px; 
	z-index:1; 
}
.blog-summary {  
	width:665px;
	z-index:2; 
	position:absolute; 
	bottom:0px; 
	padding:15px; 
	font-size:12px; 
	font-weight:300;
}
.blog-summary p { 
	color:#fff; 
	padding:0px; 
	margin:0px 10px 0px 0px; 
	float:left; [COLOR=#000000]}[/COLOR]
 

Black_Sky

کاربر عضو
کد زیر تست کنید:


کد:
<div class="slider-wrap">
    <ul class="bxslider">
<?php $recent = new WP_Query("cat=2&showposts=3");
while($recent->have_posts())
: $recent->the_post();?>
<li id="post-<?php the_ID(); ?>">
<div class="blog-featured"> 
<a href="<?php the_permalink(); ?>" rel="bookmark" > <?php the_post_thumbnail(); ?></a></div>
<div class="blog-summary alpha60">
<?php the_excerpt(); ?><a href='<?php the_permalink(); ?>' rel="bookmark" >Read More >> </a>
</div></li>
<?php endwhile; ?>
</ul>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
	<?php 
		endif;
		wp_reset_postdata(); 	?>
 

alihesari

کاربر عضو
در قالب این متن نمایش داده میشه بجای پست

  • have_posts()) : $recent->the_post();?>



[h=2]Not Found[/h]Sorry, but you are looking for something that isn't here.

 

Black_Sky

کاربر عضو
این کد ul تست کنید:


کد:
<ul class="bxslider">
<?php $recent = new WP_Query("cat=2&showposts=3");
while($recent->have_posts())
: $recent->the_post();?>
<li>
<div class="blog-featured"> 
<a href="<?php the_permalink(); ?>" rel="bookmark" ><?php the_post_thumbnail(); ?></a></div>
<div class="blog-summary alpha60">
<?php the_excerpt(); ?><a href='<?php the_permalink(); ?>' rel="bookmark" >Read More >> </a>
</div></li>
<?php endwhile; ?>
</ul>
 
بالا