Javascript,Nodejs,MongodDB,WordPress,CSS,PHP

LightBlog

Thursday, August 23, 2018

Add theme support



wordpress give us a feature to enable the functionalities of wordpress.
which is known as theme_support,this Must be called in the theme’s functions.php file to work. If attached to a hook, it must be ‘after_setup_theme’. The ‘init’ hook may be too invoke for some features.

syntax:

register theme support

add_theme_support( string $feature )

add_theme_support( 'custom-header' ); // Register custom header
add_theme_support( 'custom-logo' ); // Register custom logo
add_theme_support( 'widgets' ); // Register widgets
add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );

add_theme_support( 'post-thumbnails' );                  // enable 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 custom post type

add_theme_support('menus');                                      // Register menus in dashboard

No comments:

Post a Comment