Skip to content

Instantly share code, notes, and snippets.

@Rayhanuc
Created September 23, 2018 09:10
Show Gist options
  • Save Rayhanuc/22aff14e1401fc8ff745a325163f187d to your computer and use it in GitHub Desktop.
Save Rayhanuc/22aff14e1401fc8ff745a325163f187d to your computer and use it in GitHub Desktop.
another shortcode test
//industry_rayhan_shortcode start
function industry_rayhan_shortcode($atts){
extract( shortcode_atts( array(
'count' => 2,
'type' => 'page',
), $atts) );
$arg = array(
'post_type' => $type,
'posts_per_page' => $count,
);
$get_post = new WP_Query($arg);
$plist_markup = '<div class="row">';
while ($get_post->have_posts()) : $get_post->the_post();
$post_id = get_the_ID();
$plist_markup .= '<div class="col-md-6 col-part">This is my title</div>';
endwhile;
$plist_markup .= '</div>';
wp_reset_query();
return $plist_markup;
}
add_shortcode('p_list', 'industry_rayhan_shortcode');
//industry_rayhan_shortcode end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment