'1'
), $atts));
ob_start();
if($cat =='All')
{
$args = array(
'posts_per_page' => 10,
'numberposts' => 5,
'offset' => 0,
'category' => '',
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'faqs',
'post_status' => 'publish',
);
$loop = new WP_Query( $args );
echo '
';
$counter = 1 ;
while ($loop->have_posts() ) : $loop->the_post();
if($counter == 4){ echo '
';
}
else
{
$args = array(
'posts_per_page' => 5,
'numberposts' => 5,
'offset' => 0,
'category' => '',
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'faqs',
'post_status' => 'publish',
);
$args['tax_query'][] = array(
'taxonomy' => 'faqs_catagories',
'field' => 'slug',
'terms' => $cat);
$loop = new WP_Query( $args );
$i=0;
echo '
';
while ( $loop->have_posts() ) : $loop->the_post();
$count_posts = wp_count_posts();
?>
';
}
$categories = ob_get_contents();
ob_end_clean();
return $categories;
}
add_shortcode( 'Faqs', 'categories_list_func');
add_action('init', 'add_faq_button');
function add_faq_button()
{
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
{
return;
}
if ( get_user_option('rich_editing') == 'true' )
{
add_filter( 'mce_external_plugins', 'add_faq_plugin' );
add_filter( 'mce_buttons', 'register_faq_button' );
}
}
function register_faq_button( $buttons )
{
array_push($buttons, "|", "faq");
return $buttons;
}
function add_faq_plugin( $plugin_array )
{
$plugin_array['faq'] = get_template_directory_uri().'/shortcode/FAQ/faq_shortcode.js';
return $plugin_array;
}
?>