Created
September 23, 2018 09:10
-
-
Save Rayhanuc/22aff14e1401fc8ff745a325163f187d to your computer and use it in GitHub Desktop.
another shortcode test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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