Popusti list shortcode
// Add Shortcode
function popusti_shortcode( $atts ) {
// Attributes
extract( shortcode_atts(
array(
'tax_id' => '1',
), $atts )
);
// Code
$output = '<ul>';
$the_query = new WP_Query( array ( 'posts_per_page' => $posts ) );
while ( $the_query->have_posts() ):
$the_query->the_post();
$output = '<li>' . get_the_title() . '</li>';
endwhile;
wp_reset_postdata();
$output = '</ul>';
return $output;
}
add_shortcode( 'popusti', 'popusti_shortcode' );