Last active
April 27, 2019 21:51
-
-
Save eri-trabiccolo/9ee91a783a3889f594af to your computer and use it in GitHub Desktop.
Show featured image in pages
This file contains 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
add_filter('tc_show_single_post_content', 'thumbnails_css_in_pages'); | |
function thumbnails_css_in_pages( $bool ){ | |
global $wp_current_filter, $post; | |
if ( is_page() && isset( $post ) && ! in_array( '__loop', $wp_current_filter) ) | |
return true; | |
return $bool; | |
} | |
/* do not copy the following in your child-theme functions.php*/ | |
/* Following code must be copied in your child-theme style.css without the comments */ | |
/* Replace 250px with the value you set in the single post thumbnail options*/ | |
/* | |
body.page .tc-rectangular-thumb { | |
height: 250px; | |
max-height: 250px; | |
} | |
*/ |
Thanks. Actually I wrote gists were just a way to share the code with people who knew where to put it, because I told them along with a link to the gist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easy to add to functions.php. Usually you should mention wich document is related to this document :)