recent_func

Recent Posts.

Description

recent_func( $atts ); 

Parameters (1)

0. $atts
The atts.

Usage

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

Defined (1)

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

/functions/shortcodes.php  
  1. function recent_func($atts) { 
  2.  
  3.  
  4.  
  5. extract(shortcode_atts(array( 
  6. 'class_name' => 'cat-post',  
  7. 'totalposts' => '8',  
  8. 'thumbnail' => 'false',  
  9. 'excerpt' => 'false',  
  10. 'orderby' => 'post_date' 
  11. ), $atts)); 
  12. $pcat = get_option('of_portfolio_category'); 
  13. $pcatid = get_cat_id($pcat); 
  14. $output = '<ul class="frame">'; 
  15. global $post; 
  16. $myposts = get_posts('numberposts=8&category='.$pcatid.'&orderby=$orderby'); 
  17.  
  18.  
  19. foreach($myposts as $post) { 
  20. setup_postdata($post); 
  21. $output .= '<li>'; 
  22.  
  23. $output .= '<a href="'.get_permalink().'">'.get_the_post_thumbnail(null, 'mini_thumbnail').'</a>'; 
  24.  
  25. $output .= '</li>'; 
  26.  
  27. }; 
  28. $output .= '</ul>'; 
  29. return $output;