featured_galleries

The Responsive Minimal featured galleries function.

Description

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

Parameters (2)

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

Usage

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

Defined (1)

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

/functions/shortcodes.php  
  1. function featured_galleries($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_2").carouFredSel({ 
  12. items: {visible: '.$number.', minimum: 1},  
  13. scroll: { items: 1, pauseOnHover: true},  
  14. auto: false,  
  15. prev : { button: "#prev_2"},  
  16. next : { button : "#next_2"},  
  17. }); 
  18.  
  19. jQuery("a[rel=\'lightbox\']").colorbox(); 
  20. jQuery("#click").click(function() {  
  21. return false; 
  22. }); 
  23. }); 
  24. </script>'; 
  25. $multitask.= 
  26. '<div class="featured_items_slider_2"> 
  27. <div class="featured_container_2 feat_box_'.$style.'" > 
  28. <ul id="carousel_2">'; 
  29. $results = get_terms('galleries'); 
  30. if ($results) { 
  31. $featg = new WP_Query(array('post_type' => 'wtsgallery', 'posts_per_page' => 100)); 
  32. if ($featg->have_posts()) : while ($featg->have_posts()) : $featg->the_post(); 
  33. // 
  34. $full_img = get_the_post_thumbnail($post->ID, 'full'); 
  35. $find_ini = 'src="'; 
  36. $find_end = '"'; 
  37. $pos_1 = strpos($full_img, $find_ini)+5; 
  38. $part_1 = substr($full_img, $pos_1); 
  39. $pos_2 = strpos($part_1, $find_end); 
  40. $full = substr($part_1, 0, $pos_2); 
  41. // 
  42. $custom = get_post_custom($post->ID); 
  43. $caption_img = $custom["caption_img"][0]; 
  44. $featured_item = $custom["featured_item"][0]; 
  45. if($featured_item=='on') { 
  46. $multitask.= '<li class="container_hover_shine"><a href="'.$full.'" class="popup" title="'.$caption_img.'" rel="lightbox">'.get_the_post_thumbnail($id, array(150, 150)).'<div class="hover_shine"></div></a></li>'; 
  47. endwhile;endif; 
  48. wp_reset_query(); 
  49. $multitask.='</ul> 
  50. <a class="prev" id="prev_2" href="#"><span>prev</span></a> 
  51. <a class="next" id="next_2" href="#"><span>next</span></a> 
  52. </div> 
  53. </div>'; 
  54. return $multitask;