Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'theme_mod_jnews_single_blog_template', 'change_jnews_single_post_template' );
- add_filter( 'theme_mod_jnews_single_blog_custom', 'change_jnews_custom_single_post_template' );
- /**
- * Change JNews single post tempalte with custom
- *
- * @param string $template Template name.
- * @return string
- */
- function change_jnews_single_post_template( $template ) {
- if ( 'image' === get_post_format() ) {
- return 'custom';
- }
- return $template;
- }
- /**
- * Change JNews custom post template id.
- *
- * @param int|string $template Single Post Template ID.
- * @return integer|string
- */
- function change_jnews_custom_single_post_template( $template ) {
- if ( 'image' === get_post_format() ) {
- return 248; /* Change this with your Custom Single Post Template ID */
- }
- return $template;
- }
Advertisement
Add Comment
Please, Sign In to add comment