wp arras slideshow problem

WordPress Themes

Συντονιστές: WebDev Moderators, Super-Moderators, PHP Moderators

Απάντηση
Άβαταρ μέλους
JohnMorf
Δημοσιεύσεις: 435
Εγγραφή: 20 Αύγ 2011 22:31
Τοποθεσία: Αθήνα
Επικοινωνία:

wp arras slideshow problem

Δημοσίευση από JohnMorf » 06 Νοέμ 2011 22:55

evgala ton kwdika tou slideshow gt ekana ena lathos. xerei kaneis na me voithisei na to ftiaxw?

na o kwdikas
<?php











function arras_add_slideshow() {



global $post_blacklist, $paged;



if ( !is_home() || $paged ) return false;







$slideshow_cat = arras_get_option('slideshow_cat');







if (arras_get_option('enable_slideshow') == false) return false;







$query = arras_prep_query( array(



'list' => $slideshow_cat,



'taxonomy' => arras_get_option('slideshow_tax'),



'query' => array(



'posts_per_page' => arras_get_option('slideshow_count'),



'exclude' => $post_blacklist,



'post_type' => arras_get_option('slideshow_posttype'),



'paged' => $paged



)



) );







$q = new WP_Query( apply_filters('arras_slideshow_query', $query) );



if ($q->have_posts()) :



?>



<!-- Featured Slideshow -->



<div class="featured clearfix">



<?php if ($q->post_count > 1) : ?>



<div id="controls">



<a href="" class="prev"><?php _e('Prev', 'arras') ?></a>



<a href="" class="next"><?php _e('Next', 'arras') ?></a>



</div>



<?php endif ?>



<div id="featured-slideshow">



<?php $count = 0; ?>







<?php while ($q->have_posts()) : $q->the_post(); ?>



<div class="featured-slideshow-inner" <?php if ($count != 0) echo 'style="display: none"'; ?>>



<a class="featured-article" href="<?php the_permalink(); ?>" rel="bookmark">



<?php echo arras_get_thumbnail('featured-slideshow-thumb'); ?>



</a>



<div class="featured-entry">



<a class="entry-title" href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>



<div class="entry-summary"><?php the_excerpt() ?></div>



<div class="progress"></div>



</div>



</div>



<?php



arras_blacklist_duplicates(); // required for duplicate posts function to work.



$count++; endwhile; ?>



</div>



</div>



<?php endif;



}







add_action('arras_above_content', 'arras_add_slideshow');







function arras_add_slideshow_js() {



?>



<script type="text/javascript">



jQuery(document).ready(function($) {







<?php if (is_home() || is_front_page()) : ?>



$('#featured-slideshow').cycle({



fx: 'fade',



speed: 250,



next: '#controls .next',



prev: '#controls .prev',



timeout: 6000,



pause: 1,



slideExpr: '.featured-slideshow-inner',



height: '<?php echo $size['h']; ?>px'



});



<?php endif ?>







});



</script>



<?php



}



add_action('wp_footer', 'arras_add_slideshow_js');







function arras_add_slideshow_thumb_size() {



$layout = arras_get_option('layout');







if ( strpos($layout, '1c') !== false ) {



$size = array(950, 450);



} else if ( preg_match('/3c/', $layout) ) {



$size = array(490, 225);



} else {



$size = array(640, 300);



}







$size = apply_filters('arras_slideshow_thumb_size', $size);



arras_add_image_size( 'featured-slideshow-thumb', __('Featured Slideshow', 'arras'), $size[0], $size[1]);



}



add_action('arras_add_default_thumbnails', 'arras_add_slideshow_thumb_size', 5);







function arras_slideshow_styles() {



$slideshow_size = arras_get_image_size('featured-slideshow-thumb');



$slideshow_size_w = $slideshow_size['w'];



$slideshow_size_h = $slideshow_size['h'];



?>



.featured { height: <?php echo $slideshow_size_h + 10 ?>px; }



.featured-article { width: <?php echo $slideshow_size_w ?>px; height: <?php echo $slideshow_size_h ?>px; }



.featured-article img { width: <?php echo $slideshow_size_w ?>px; height: <?php echo $slideshow_size_h ?>px; }



#controls { width: <?php echo $slideshow_size_w - 30 ?>px; top: <?php echo ($slideshow_size_h / 2) - 15 ?>px; }



#controls .next { left: <?php echo $slideshow_size_w - 30 ?>px; }



.featured-entry { height: <?php echo ceil($slideshow_size_h / 3) ?>px; top: -<?php echo ceil($slideshow_size_h / 3) ?>px; }



.featured-slideshow-inner { height: <?php echo $slideshow_size_h ?>px }



<?php



}



add_action('arras_custom_styles', 'arras_slideshow_styles');







/* End of file slideshow.php */



/* Location: ./library/slideshow.php */
Του Μπι ορ νοτ του μπι; Δατς δε κουέστιον...

Άβαταρ μέλους
bibisidis
Honorary Member
Δημοσιεύσεις: 924
Εγγραφή: 07 Ιούλ 2010 03:32

wp arras slideshow problem

Δημοσίευση από bibisidis » 07 Νοέμ 2011 17:05

Αυτο που μας δινεις εδω ειναι το slideshow.php
Δεν μπορω να καταλαβω τι εννοεις κα ιπιο εινα ιτο προβλημα σου. Υποψιαζομαι ομως οτι το πειραξες και θελεις ξανα το αρχικο slideshow.php

Αυτο εινα ιτο arxiko slideshow.php

Κώδικας: Επιλογή όλων

<?php 

function arras_add_slideshow&#40;&#41; &#123;
	global $post_blacklist;
	if &#40;!is_home&#40;&#41;&#41; return false;
	
	$slideshow_cat = arras_get_option&#40;'slideshow_cat'&#41;;
	
	if &#40;arras_get_option&#40;'enable_slideshow'&#41; == false&#41; return false;
	
	$query = arras_parse_query&#40;$slideshow_cat, arras_get_option&#40;'slideshow_count'&#41;, array_unique&#40;$post_blacklist&#41;, arras_get_option&#40;'slideshow_posttype'&#41;, arras_get_option&#40;'slideshow_tax'&#41;&#41;;
	
	$q = new WP_Query&#40; apply_filters&#40;'arras_slideshow_query', $query&#41; &#41;;
	if &#40;$q->have_posts&#40;&#41;&#41; &#58;
	?> 
	<!-- Featured Slideshow -->
	<div class="featured clearfix">
		<?php if &#40;$q->post_count > 1&#41; &#58; ?>
		<div id="controls">
			<a href="" class="prev"><?php _e&#40;'Prev', 'arras'&#41; ?></a>
			<a href="" class="next"><?php _e&#40;'Next', 'arras'&#41; ?></a>
		</div>
		<?php endif ?>
		<div id="featured-slideshow">
			<?php $count = 0; ?>
		
			<?php while &#40;$q->have_posts&#40;&#41;&#41; &#58; $q->the_post&#40;&#41;; ?>
			<div class="featured-slideshow-inner" <?php if &#40;$count != 0&#41; echo 'style="display&#58; none"'; ?>>
				<a class="featured-article" href="<?php the_permalink&#40;&#41;; ?>" rel="bookmark">
				<?php echo arras_get_thumbnail&#40;'featured-slideshow-thumb'&#41;; ?>
				</a>
				<div class="featured-entry">
					<a class="entry-title" href="<?php the_permalink&#40;&#41;; ?>" rel="bookmark"><?php the_title&#40;&#41;; ?></a>
					<div class="entry-summary"><?php the_excerpt&#40;&#41; ?></div>
					<div class="progress"></div>
				</div>
			</div>
			<?php 
			arras_blacklist_duplicates&#40;&#41;; // required for duplicate posts function to work.
			$count++; endwhile; ?>
		</div>
	</div>
	<?php endif;
&#125;

add_action&#40;'arras_above_content', 'arras_add_slideshow'&#41;;

function arras_add_slideshow_js&#40;&#41; &#123;
?>
<script type="text/javascript">
jQuery&#40;document&#41;.ready&#40;function&#40;$&#41; &#123;

<?php if &#40;is_home&#40;&#41; || is_front_page&#40;&#41;&#41; &#58; ?>
$&#40;'#featured-slideshow'&#41;.cycle&#40;&#123;
	fx&#58; 'fade',
	speed&#58; 250,
	next&#58; '#controls .next',
	prev&#58; '#controls .prev',
	timeout&#58; 6000,
	pause&#58; 1,
	slideExpr&#58; '.featured-slideshow-inner',
	height&#58; '<?php $size = arras_get_image_size&#40;'featured-slideshow-thumb'&#41;; echo $size&#91;'h'&#93;; ?>px'
&#125;&#41;;
<?php endif ?>
	
&#125;&#41;;
</script>
<?php
&#125;
add_action&#40;'wp_footer', 'arras_add_slideshow_js'&#41;;

function arras_add_slideshow_thumb_size&#40;&#41; &#123;
	$layout = arras_get_option&#40;'layout'&#41;;
	
	if &#40; strpos&#40;$layout, '1c'&#41; !== false &#41; &#123;
		$size = array&#40;950, 300&#41;;
	&#125; else if &#40; strpos&#40;$layout, '3c'&#41; !== false &#41; &#123;
		$size = array&#40;490, 225&#41;;
	&#125; else &#123;
		$size = array&#40;640, 250&#41;;
	&#125;
	
	$size = apply_filters&#40;'arras_slideshow_thumb_size', $size&#41;;
	arras_add_image_size&#40; 'featured-slideshow-thumb', __&#40;'Featured Slideshow', 'arras'&#41;, $size&#91;0&#93;, $size&#91;1&#93;&#41;;
&#125;
add_action&#40;'arras_add_default_thumbnails', 'arras_add_slideshow_thumb_size', 5&#41;;

function arras_slideshow_styles&#40;&#41; &#123;
	$slideshow_size = arras_get_image_size&#40;'featured-slideshow-thumb'&#41;;
	$slideshow_size_w = $slideshow_size&#91;'w'&#93;;
	$slideshow_size_h = $slideshow_size&#91;'h'&#93;;
	?>
	.featured &#123; height&#58; <?php echo $slideshow_size_h + 10 ?>px; &#125;
	.featured-article &#123; width&#58; <?php echo $slideshow_size_w ?>px; height&#58; <?php echo $slideshow_size_h ?>px; &#125;
	.featured-article img &#123; width&#58; <?php echo $slideshow_size_w ?>px; height&#58; <?php echo $slideshow_size_h ?>px; &#125;
	#controls &#123; width&#58; <?php echo $slideshow_size_w - 30 ?>px; top&#58; <?php echo &#40;$slideshow_size_h / 2&#41; - 15 ?>px; &#125;
	#controls .next &#123; left&#58; <?php echo $slideshow_size_w - 30 ?>px; &#125;
	.featured-entry &#123; height&#58; <?php echo ceil&#40;$slideshow_size_h / 3&#41; ?>px; top&#58; -<?php echo ceil&#40;$slideshow_size_h / 3&#41; ?>px; &#125;
	.featured-slideshow-inner &#123; height&#58; <?php echo $slideshow_size_h ?>px &#125;
	<?php
&#125;
add_action&#40;'arras_custom_styles', 'arras_slideshow_styles'&#41;;

/* End of file slideshow.php */
/* Location&#58; ./library/slideshow.php */

Άβαταρ μέλους
bibisidis
Honorary Member
Δημοσιεύσεις: 924
Εγγραφή: 07 Ιούλ 2010 03:32

wp arras slideshow problem

Δημοσίευση από bibisidis » 07 Νοέμ 2011 17:09

Αφου έχεις αρχισει να σκαλιζεις τετοια αρχεια ριξε μια ματια πρωτα εδω http://www.freestuff.gr/forums/viewtopic.php?t=18958

Και ακομη καλυτερα ξεκινα απο εδω
http://www.freestuff.gr/forums/viewtopic.php?t=19080

Απάντηση

Επιστροφή στο “WordPress Themes”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες