Accordian Slider with Custom Post

function tiptrick_shortcode($atts, $content){
extract (shortcode_atts( array( ‘posts’ => 4, ‘category_slug’ => “tipstricks-default-category”,

), $atts ));
global $post;

$args=array( ‘post_type’=>’tiptrick’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => $posts, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘caller_get_posts’=> 1, ‘tiptrick_cat’=> $category_slug,
‘tax_query’ => array(
‘taxonomy’ => ‘tiptrick_cat’,
‘field’    => ‘slug’,
‘terms’    => array($category_slug),
$catObj = get_term_by(‘slug’, $category_slug, ‘tiptrick_cat’);
$catName = $catObj->name;
$posts = new WP_Query($args);
$output = ”;

$output.='<section class=”horizontalaccordian”>

‘.$catName.’ …View More >>


$var='{“active”: 2,”responsive”: true,”orientation”: “horizontal”,  “theme”: “silver”, “shadows”: true,”bordered”: true, “slider”: true, “rounded”: false, “width”: 1600, “height”:600, “dotNav”:true, “containerHeight”: 320, “headerSize”:68, “animation”: {“duration”:3200, “easing”: “easeInOutQuart”}, “showIcons”: true,”headerFontSize”: 1.6, “autoplay”: {“interval”:6000}}’;



while ($posts->have_posts()): $posts->the_post();
$thumbnail = get_the_post_thumbnail($post->ID);




‘. $thumbnail.’

‘.get_the_excerpt().’See More >>




return html_entity_decode($output);
add_shortcode( ‘tiptrick’, ‘tiptrick_shortcode’ );


Published by


I am a developer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s