Custom Snippet

Use this tool to share WordPress snippets with the community.

  Save Snippet
<?php

// Add SQR team Shortcode
function sqr_team_shortcode( $atts ) {


	// Code
ob_start();?>
<div id="team-shortcode-list" style="width:100%;"><div class="s_team">
<?php
	$args = array( 'post_type' => 'team', 'posts_per_page' =>100);
	$loop = new WP_Query( $args );
	while ( $loop->have_posts() ) : $loop->the_post();
		echo '<div class="s-team-picture"><a href="',get_permalink(),'">', the_post_thumbnail('team'), '</a></div><!-- s-team-picture -->';	
	endwhile;?>
</div><!-- s_team --></div><!-- #team-shortcode-list -->
<?php
return ob_get_clean();

}
add_shortcode( 'sqr_team', 'sqr_team_shortcode' );
?>