'post', 'show' => 4, 'template' => false ), $atts)); $args = [ 'public' => true ]; $output = ''; $post_types = get_post_types($args, 'names'); if (!in_array($type, $post_types)) { $output .= '
'; $output .= '' . $type . ' '; $output .= __('in not a public post type on this website. The following post type are available: -', 'ac-wp-custom-loop-shortcode'); $output .= '
'; $output .= ''; $output .= __('Please edit the short code to use one of the available post types.', 'ac-wp-custom-loop-shortcode'); $output .= '
'; $output .= '[ ac_custome_loop type="post" show="4"]';
return $output;
}
global $wp_query;
$temp_q = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(array(
'post_type' => $type,
'showposts' => $show,
'orderby' => 'menu_order',
'order' => 'ASC'
));
if (have_posts()) :
$output .= '