Display A Post Slider Anywhere WordPress

function my_category_slider( $slider ) {

    // Display the "test" revolution on category archives
    if ( is_category() ) {
        $slider = '[rev_slider alias="test"]';
    }

    // Return specific slider for all pages if $slider not defined already
    if ( is_page() && ! $slider ) {
        $slider = 'YOUR SLIDER SHORTCODE';
    }

    // Return slider
    return $slider;
    
}
add_filter( 'wpex_post_slider_shortcode', 'my_category_slider' );
See also  Alter The “bars” (hamburger icon) In The Mobile Menu Toggle Link WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *