I created a plugin that displays staff people using a shortcode with custom category from a post type. eg. [board-members term="team1"] It works fine but only on a page or post. When I paste the shortcode into a tab (using whistles by Justin Tadlock) the profiles display outside the tab, above the tabs in the page body. what could I do to make it display inside the tab? This is the code...
require_once(dirname(__FILE__).'/post-type.php'); //file that registers CPT
function wporg_shortcodes_init(){
function wporg_shortcode($atts = []) {
extract( shortcode_atts( array(
'term' => 'columns'
), $atts ) );
$custom_taxonomy = $atts['term'];
// add query of custom post type board_members
$recentPosts = new WP_Query
(array('posts_per_page' => -1, 'post_type' => array('board_members'), 'columns' => $custom_taxonomy ));
while( $recentPosts->have_posts() ) : $recentPosts->the_post(); ?>
<div class="b-thumb"><?php the_post_thumbnail('thumbnail') ?></div>
<p class="b-info">
<span class="b-name"><?php the_title(); ?></span><br />
<span class="b-country"><?php the_field('country'); ?></span><br />
<span class="b-position"><?php the_field('position'); ?></span><br />
<span class="b-content"><?php printf(get_the_content()); ?></span><br />
</p>
<?php wp_reset_postdata(); ?>
<?php endwhile; ?>
<?php
}
add_shortcode('board-members', 'wporg_shortcode');
}
add_action('init', 'wporg_shortcodes_init');
Thanks