Quantcast
Channel: Site5 Free Premium WordPress Themes » All Posts
Viewing all articles
Browse latest Browse all 8865

Displaying a slider in your category pages

$
0
0

Does anyone know how to update the functions.php file to show a slider at the top of the category page? I found a link for another theme but it crashed my Sunrise one so I need the coding that will work with this one. Pretty Please :-)Example 1 : displaying one slider for all categories

Here is an example!

In the example below, just replace MY-SLIDER-NAME by your slider name.

Adding a slider to categories in Customizr
PHP
add_filter( ‘tc_show_slider’ , ‘show_slider_in_categories’ ); function show_slider_in_categories( $bool ) { return is_category() ? true : $bool ; } add_filter( ‘tc_slider_name_id’, ‘force_slider_name’); function force_slider_name( $original_slider_name ) { return is_category() ? ‘MY-SLIDER-NAME’ : $original_slider_name ; } add_filter( ‘tc_slider_active_status’ , ‘force_active_slider’ ); function force_active_slider($bool) { return is_category() ? true : $bool ; }

add_filter( ‘tc_show_slider’ , ‘show_slider_in_categories’ );
function show_slider_in_categories( $bool ) {
return is_category() ? true : $bool ;
}

add_filter( ‘tc_slider_name_id’, ‘force_slider_name’);
function force_slider_name( $original_slider_name ) {
return is_category() ? ‘MY-SLIDER-NAME’ : $original_slider_name ;
}

add_filter( ‘tc_slider_active_status’ , ‘force_active_slider’ );
function force_active_slider($bool) {
return is_category() ? true : $bool ;
}


Viewing all articles
Browse latest Browse all 8865

Trending Articles