Pages

November 30, 2012

List Category Wise Content Using WP Featured Content Slider

How to Display Category wise content with WP-featured-content-slider?

Well, WP-featured-content-slider is a good way to show small introduction along side a photo with sliding effect but some times we need to list only specific categories content on some specific page so, what to do then?

Its just easy 2 step customization in plugin files, see below.

Step 1:

Open "featured-content-slider.php" file of the plugin and do following customization in function called
c_slider_insert($content = null)


add an argument "$atts" into the function if not exists. So it will looks like
function c_slider_insert($atts, $content = null) 


Now add the following code in the function at starting.
extract( shortcode_atts( array(

 'cat' => ''

 ), $atts) );




Step 2: 
Open file "content-slider.php" and then find for following code and change it
from

$args = array( 'meta_key' => 'feat_slider', 'meta_value'=> '1', 'suppress_filters' => 0, 'post_type' => array('post', 'page'), 'orderby' => $c_slider_sort, 'order' => $c_slider_order, 'numberposts'=> $c_slider_post_limit);



to


$args = array( 'meta_key' => 'feat_slider', 'meta_value'=> '1', 'suppress_filters' => 0, 'post_type' => array('post', 'page'), 'category' => $cat, 'orderby' => $c_slider_sort, 'order' => $c_slider_order, 'numberposts'=> $c_slider_post_limit);



That's it one all done. now all you need to do is specify your category while writing short code like
[featslider cat=CATEGORY_SLUG]


All done! Enjoy coding...
You Might be Interested
WordPress eStore

No comments:

Post a Comment

Kindle Apps