themeeewee_shortcode_post_function

The Eewee responsive design themeeewee shortcode post function function.

Description

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

Parameters (2)

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

Usage

  1. if ( !function_exists( 'themeeewee_shortcode_post_function' ) ) { 
  2. require_once '/includes/shortcodes/post/post.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 = themeeewee_shortcode_post_function($atts, $content); 
  12.  

Defined (1)

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

/includes/shortcodes/post/post.php  
  1. function themeeewee_shortcode_post_function($atts, $content = null) { 
  2.  
  3. extract(shortcode_atts(array( 
  4. 'type' => '',  
  5. 'categ' => '',  
  6. 'qty' => '3',  
  7. 'w' => '' 
  8. ), $atts)); 
  9.  
  10. switch( $type ) { 
  11. case "tab" : 
  12. $tools = new ToolsController(); 
  13.  
  14. // categ 
  15. $args = array(); 
  16. if( !empty($categ) ) { 
  17. $args['include'] = $categ; 
  18.  
  19. $defaults = array( 
  20. 'type' => 'post',  
  21. 'child_of' => 0,  
  22. 'parent' => '',  
  23. 'orderby' => 'name',  
  24. 'order' => 'ASC',  
  25. 'hide_empty' => 1,  
  26. 'hierarchical' => 1,  
  27. 'exclude' => '',  
  28. 'include' => '',  
  29. 'number' => '',  
  30. 'taxonomy' => 'category',  
  31. 'pad_counts' => true ); 
  32. $tbl = array_merge($defaults, $args); 
  33. $liste_categs = get_categories( $tbl ); 
  34.  
  35. foreach( $liste_categs as $liste_categ ) { 
  36. $defaults = array( 
  37. 'numberposts' => $qty,  
  38. 'offset' => 0,  
  39. 'category' => $liste_categ->term_id,  
  40. 'orderby' => 'post_date',  
  41. 'order' => 'DESC',  
  42. 'include' => '',  
  43. 'exclude' => '',  
  44. 'meta_key' => '',  
  45. 'meta_value' => '',  
  46. 'post_type' => 'post',  
  47. 'post_mime_type' => '',  
  48. 'post_parent' => '',  
  49. 'post_status' => 'publish' ); 
  50. $posts_array[ $liste_categ->slug ] = get_posts( $defaults ); 
  51. }//fin foreach 
  52. $actus = $posts_array; 
  53.  
  54. $onglet = ' 
  55. <ul class="nav nav-tabs" id="myTab">'; 
  56.  
  57. foreach( $liste_categs as $liste_categ ) { 
  58. $onglet .= '<li><a href="#'.$liste_categ->slug.'">'.$liste_categ->name.'</a></li>'; 
  59.  
  60. $onglet .= ' 
  61. </ul> 
  62.  
  63. <div class="tab-content">'; 
  64.  
  65. foreach( $liste_categs as $liste_categ ) { 
  66.  
  67. $onglet .= '<div class="tab-pane" id="'.$liste_categ->slug.'">'; 
  68.  
  69. foreach( $actus[$liste_categ->slug] as $actu ) { 
  70. //$onglet .= "  
  71. //<div class='row-fluid'> 
  72. // <div class='span3'>"; 
  73. $thumbnail = get_the_post_thumbnail(  
  74. $actu->ID,  
  75. array(200, 150),  
  76. array( 
  77. 'class'=>'img-rounded pull-left post-tab-marge-img',  
  78. 'alt' => trim(strip_tags( $actu->post_excerpt )),  
  79. 'title' => trim(strip_tags( $actu->post_title )) 
  80. ); 
  81. if( empty( $thumbnail ) ) { 
  82. $onglet .= ""; 
  83. }else{ 
  84. $onglet .= $thumbnail; 
  85. // $onglet .= "  
  86. // </div> 
  87. // <div class='span9'>"; 
  88.  
  89. $onglet .= " 
  90. <h3>".$actu->post_title."</h3> 
  91. ".$tools->getContentLimit($actu->post_content, 300)."<br /> 
  92. <br />"; 
  93.  
  94. $onglet .= " 
  95. <div class='row-fluid'> 
  96. <div class='span2'>"; 
  97.  
  98. $onglet .= "  
  99. <a href='".get_permalink($actu->ID)."'>".__("Read more", "eewee")."...</a><br /> 
  100. <br /> 
  101. "; 
  102.  
  103. $onglet .= " 
  104. </div> 
  105. <div class='span2'>"; 
  106.  
  107. $onglet .= " 
  108. <div class='addthis_toolbox addthis_default_style '> 
  109. <a class='addthis_button_preferred_1'></a> 
  110. <a class='addthis_button_preferred_2'></a> 
  111. <a class='addthis_button_preferred_3'></a> 
  112. <a class='addthis_button_preferred_4'></a> 
  113. <a class='addthis_button_compact'></a> 
  114. <a class='addthis_counter addthis_bubble_style'></a> 
  115. </div> 
  116. <script type='text/javascript' src='http://s7.addthis.com/js/300/addthis_widget.js#pubid=xa-5076ec8624ddff17'></script> 
  117. <br />"; 
  118.  
  119. $onglet .= " 
  120. </div> 
  121. </div>"; 
  122.  
  123. // $onglet .= "  
  124. // </div> 
  125. //</div>"; 
  126.  
  127.  
  128. $onglet .= '</div>'; 
  129.  
  130.  
  131. $onglet .= ' 
  132. </div> 
  133.  
  134. <script type="text/javascript"> 
  135. jQuery(document).ready(function($) { 
  136. $(document).ready(function() { 
  137. $("#myTab a").click(function (e) { 
  138. e.preventDefault(); 
  139. $(this).tab("show"); 
  140. }); 
  141.  
  142. $("#myTab a:first").tab("show"); 
  143. }); 
  144. }); 
  145. </script>'; 
  146. $d = $onglet; 
  147.  
  148. /**$d = ' 
  149. <ul class="nav nav-tabs" id="myTab"> 
  150. <li class="active"><a href="#home">Home</a></li> 
  151. <li><a href="#profile">Profile</a></li> 
  152. <li><a href="#messages">Messages</a></li> 
  153. <li><a href="#settings">Settings</a></li> 
  154. </ul> 
  155.  
  156. <div class="tab-content"> 
  157. <div class="tab-pane active" id="home">xxx</div> 
  158. <div class="tab-pane" id="profile">aaa</div> 
  159. <div class="tab-pane" id="messages">bbb</div> 
  160. <div class="tab-pane" id="settings">ccc</div> 
  161. </div> 
  162.  
  163. <script type="text/javascript"> 
  164. jQuery(document).ready(function($) { 
  165. $(document).ready(function() { 
  166. $("#myTab a").click(function (e) { 
  167. e.preventDefault(); 
  168. $(this).tab("show"); 
  169. }); 
  170.  
  171. $("#myTab a:first").tab("show"); 
  172. }); 
  173. }); 
  174. </script>';*/ 
  175.  
  176. break; 
  177.  
  178. case "accordion" : 
  179. $d = 'accordion here'; 
  180. break; 
  181. return $d;