featured_services

The Responsive Minimal featured services function.

Description

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

Parameters (2)

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

Usage

  1. if ( !function_exists( 'featured_services' ) ) { 
  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 = featured_services($atts, $content); 
  12.  

Defined (1)

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

/functions/shortcodes.php  
  1. function featured_services($atts, $content = null) { 
  2. global $post, $wpdb, $wp_query, $query_string; 
  3. extract( shortcode_atts( array( 
  4. 'number' => '5',  
  5. 'style' => '1' 
  6. ), $atts ) ); 
  7.  
  8. $multitask = ' 
  9. <script type="text/javascript"> 
  10. jQuery(document).ready(function() { 
  11. jQuery("#carousel_5").carouFredSel({ 
  12. items: {visible: '.$number.', minimum: 1},  
  13. scroll: { items: 1, pauseOnHover: true},  
  14. auto: false,  
  15. prev : { button: "#prev_5"},  
  16. next : { button : "#next_5"},  
  17. }); 
  18. }); 
  19. </script>'; 
  20. $multitask.= 
  21. '<div class="featured_items_slider_2"> 
  22. <div class="featured_container_2 feat_box_'.$style.'"> 
  23. <ul id="carousel_5">'; 
  24. $results = get_terms('brochures'); 
  25. if ($results) { 
  26. $feats = new WP_Query(array('post_type' => 'wtsservice', 'posts_per_page' => 100)); 
  27. if ($feats->have_posts()) : while ($feats->have_posts()) : $feats->the_post(); 
  28. $custom = get_post_custom($post->ID); 
  29. $featured_item = $custom["featured_item"][0]; 
  30. if($featured_item=='on') { 
  31. $multitask.= '<li class="container_hover_shine"><a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_post_thumbnail($id, array(150, 150)).'<div class="hover_shine"></div></a></li>'; 
  32. endwhile;endif; 
  33. wp_reset_query(); 
  34. $multitask.='</ul> 
  35. <a class="prev" id="prev_5" href="#"><span>prev</span></a> 
  36. <a class="next" id="next_5" href="#"><span>next</span></a> 
  37. </div> 
  38. </div>'; 
  39. return $multitask;