Advertisement
kobial8

Double Shortcode Snippet

Feb 12th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. // double shortcodes
  2.  
  3. function double_shortcodes($atts){
  4.     extract( shortcode_atts( array(
  5.         'title' => 'Enter Default Value',
  6.         'des' => 'Enter Default Value',
  7.  
  8.     ), $atts, 'double' ) );
  9.    
  10.     $q = new WP_Query(
  11.         array('posts_per_page' => 4, 'post_type' => 'portfolio', 'order' => 'ASC')
  12.         );      
  13.        
  14.        
  15.     $list = '';
  16.     while($q->have_posts()) : $q->the_post();
  17.         $idd = get_the_ID();
  18.         $portfolio_photo_lg = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'portfolio-large' );
  19.         $portfolio_photo_sm = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'portfolio-small' );
  20.         $filter = get_post_meta($idd, 'filter', true);
  21.  
  22.         $list .= '';        
  23.     endwhile;
  24.     $list.= '';
  25.     wp_reset_query();
  26.     return $list;
  27. }
  28. add_shortcode('double', 'double_shortcodes');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement