testimonials

The Responsive Minimal testimonials function.

Description

testimonials( $atts, (constant) $content = null ); 

Parameters (2)

0. $atts
The atts.
1. $content — Optional. (constant) => null
The content.

Usage

  1. if ( !function_exists( 'testimonials' ) ) { 
  2. require_once '/functions/shortcodes.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // The content. 
  8. $content = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = testimonials($atts, $content); 
  12.  

Defined (1)

The function is defined in the following location(s).

/functions/shortcodes.php  
  1. function testimonials($atts, $content = null) { 
  2. global $post, $wpdb, $wp_query, $query_string; 
  3. extract( shortcode_atts( array( 
  4. 'number' => '3',  
  5. 'stylebox' => '1',  
  6. 'stylequote' => '1',  
  7. 'quotecolor' => 'gray' 
  8. ), $atts ) ); 
  9.  
  10. $multitask = ' 
  11. <script type="text/javascript"> 
  12. jQuery(document).ready(function() { 
  13. jQuery("#carousel_6").carouFredSel({ 
  14. items: {visible: '.$number.', minimum: 1},  
  15. scroll: { items: 1, pauseOnHover: true},  
  16. auto: false,  
  17. prev : { button: "#prev_6"},  
  18. next : { button : "#next_6"},  
  19. }); 
  20. }); 
  21. </script>'; 
  22. $multitask.= 
  23. '<div class="featured_items_slider_2"> 
  24. <div class="featured_container_2 feat_box_'.$stylebox.'"> 
  25. <ul class="testimonial" id="carousel_6">'; 
  26. $featt = new WP_Query('post_type=wtstestimonial'); 
  27. if ($featt->have_posts()) : while ($featt->have_posts()) : $featt->the_post(); 
  28. $content = get_the_content(); 
  29. $content = apply_filters( 'the_content', $content ); 
  30. $content = str_replace( ']]>', ']]>', $content ); 
  31. $portal=trim_the_content($content, '', null, 18); 
  32. $custom = get_post_custom($post->ID); 
  33. $featured_item = $custom["featured_item"][0]; 
  34. $testimonial_by = $custom["testimonial_by"][0]; 
  35. if($featured_item=='on') { 
  36. $multitask.= ' <li id="testimonials"> 
  37. <img src="'.get_bloginfo('template_url').'/img/quotes/quote_'.$quotecolor.'_'.$stylequote.'.png" align="left"/> 
  38. <h3>'.$portal.'</h3> 
  39. <span><h3>By '.$testimonial_by.'</h3></span> 
  40. </li>'; 
  41. }endwhile;endif; wp_reset_query(); 
  42. $multitask.='</ul> 
  43. <a class="prev" id="prev_6" href="#"><span>prev</span></a> 
  44. <a class="next" id="next_6" href="#"><span>next</span></a> 
  45. </div> 
  46. </div>'; 
  47. return $multitask;