Sometimes you may like to have a slider with slides from a particular category. For example, to show all recent articles written under ‘Sports’ category. You may also think to have this ‘Sports’ category slider available in the sidebar or at the top of all articles related to Sports. It improves the site’s engagement as well as SEO for that article. With SliderVilla WordPress sliders, these requirements can be achieved without any effort. There is no need to add any code in functions.php or to have a new theme, you can achieve the requirement in any theme without writing any code.

All SliderVilla sliders come with category specific slider embed option such as shortcode, template tag and widget. Using any of these methods, you can easily embed category specific slider anywhere on your site.

For example, to have category specific Pinwheel Slider on a particular page or say. Homepage, you can use the shortcode as,

[pinwheelcategory catg_slug="sports"]

The above shortcode will embed a Pinwheel Slider with auto fetched recent articles from category named ‘Sports’. You can customize the settings e.g. width, height, image size ratio, font color, font sizes and many more using dedicated settings panel. SliderVilla sliders allow to have multiple sliders on single page as well. Which means you can have as many category specific Pinwheel sliders as you want on a single page.

Pinwheel Category Slider

Auto Detect Category

Well, in above example I mentioned the category name as ‘Sports’ but if you like to show a category specific slider on all category archive pages, then here is way to achieve that. If you want the slider in a widget ready area, you can drag and drop Pinwheel Category Slider widget in the widget ready area and do not select the category name. In that case, the slider will show recent articles from the category of the current page. Yes, it will auto detect the category and show the slides from that category only. You can also use template tag for this purpose if the area is not widget ready.

For example,

<?php if ( function_exists( 'get_pinwheel_slider_category' ) ) { get_pinwheel_slider_category(); } ?>

In the above template tag you can see that I have not mentioned any category name or slug. Now this embed code will show a Pinwheel Slider with slides from the current page’s category.

In SliderVilla sliders, there is another parameter named offset to skip first few articles to add in the slider. For example, if you want to show article number 6 – 12 in the slider, you can use offset=”5″ as a shortcode, template tag parameter and skip first 5 articles. So if you want to show older articles in the slider from Sports category, use a shortcode like,

[pinwheelcategory catg_slug="sports" offset="5"]

This feature is available in all SliderVilla sliders, checkout our 15+ premium WordPress sliders and powerful add-ons. If you want to have articles from more than one category or from some custom post type category, use our Taxonomy Add-on along with the slider.

Looking forward to see SliderVilla sliders running on your sites.

Best Sliders | Best Support