Created
November 8, 2021 00:07
-
-
Save wpexplorer/abe1a77e3ae7758271e41ab18d3a9698 to your computer and use it in GitHub Desktop.
Slider revolution - post template for different post types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set slider template ID based on post type. | |
add_filter( 'get_post_metadata', function ( $value, $post_id, $meta_key, $single ) { | |
if ( $meta_key === 'slide_template' ) { | |
$post_type = get_post_type( $post_id ); | |
switch ( $post_type ) { | |
case 'post': | |
$value = 56; // change this to the template you want for this post type. | |
break; | |
case 'page': | |
$value = 56; // change this to the template you want for this post type. | |
break; | |
} | |
} | |
return $value; | |
}, 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment