Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Description
- ===============*/
- Allows a theme or plugin to register support of a certain theme feature. If called from a theme, it should be done in the theme's functions.php file to work.
- /*Usage
- ===============*/
- <?php add_theme_support( $feature ); ?>
- /*Parameters
- =============*/
- $feature
- (string) (required) Name for the feature being added.
- Features list:
- *^* 'post-formats'
- *^* 'post-thumbnails'
- *^* 'custom-background'
- *^* 'custom-header'
- *^* 'automatic-feed-links'
- *^* 'menus'
- ***Default: None
- /*Examples
- =============*/
- ^*^ Post Thumbnails
- This feature enables Post Thumbnails support for a Theme.
- add_theme_support( 'post-thumbnails' );
- add_theme_support( 'post-thumbnails', array( 'post' ) ); // Posts only
- add_theme_support( 'post-thumbnails', array( 'page' ) ); // Pages only
- add_theme_support( 'post-thumbnails', array( 'post', 'movie' ) ); // Posts and Movies
- set_post_thumbnail_size( 200, 200, true ); // Sets the size of thubnails
- add_image_size( 'post-image', 150, 150, true ); // Sets the size of Post-Images
- Codes must be inside <?php?> Tag.This feature must be called before the init hook is fired. That means it needs to be placed directly into functions.php.
Advertisement
Add Comment
Please, Sign In to add comment