/** * Theme setup */ function setup() { // Enable features from Soil when plugin is activated // https://roots.io/plugins/soil/ add_theme_support('soil-clean-up'); add_theme_support('soil-nav-walker'); add_theme_support('soil-nice-search'); add_theme_support('soil-jquery-cdn'); add_theme_support('soil-relative-urls'); // Make theme available for translation // Community translations can be found at https://github.com/roots/sage-translations load_theme_textdomain('sage', get_template_directory() . '/lang'); // Enable plugins to manage the document title // http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag add_theme_support('title-tag'); // Register wp_nav_menu() menus // http://codex.wordpress.org/Function_Reference/register_nav_menus register_nav_menus(['primary_navigation' => __('Primary Navigation', 'sage')]); // Enable post thumbnails // http://codex.wordpress.org/Post_Thumbnails // http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size // http://codex.wordpress.org/Function_Reference/add_image_size add_theme_support('post-thumbnails'); set_post_thumbnail_size(1020, 900); // Enable post formats // http://codex.wordpress.org/Post_Formats //add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']); // Enable HTML5 markup support // http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5 add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']); // Use main stylesheet for visual editor // To add custom styles edit /assets/styles/layouts/_tinymce.scss add_editor_style(Assets\asset_path('styles/main.css')); }
/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function actions_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on actions, use a find and replace * to change 'actions' to the name of your theme in all the template files. */ load_theme_textdomain('actions'); /** * Add default posts and comments RSS feed links to head. */ add_theme_support('automatic-feed-links'); add_theme_support('customize-selective-refresh-widgets'); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(640, 300); // This theme uses wp_nav_menu() in one locations. register_nav_menus(array('primary' => esc_html__('Primary Menu', 'actions'))); /* * Switch default core markup for search form, comment form, comments, galleries, captions and widgets * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'widgets')); /* * Enable support for site logo. */ add_theme_support('custom-logo', array('height' => 150, 'width' => 250, 'flex-height' => true, 'header-text' => array('site-title', 'site-description'))); // Declare support for title theme feature add_theme_support('title-tag'); }
function renova_setup() { //Feed links add_theme_support('automatic-feed-links'); //Nav menu register_nav_menu('primary', __('Primary Menu', 'renovalang')); //Sidebar $args = array('name' => __('renova_side', 'renovalang'), 'id' => 'renova01', 'description' => '', 'class' => '', 'before_widget' => '<section id="%1$s" class="blog-side-panel %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2>', 'after_title' => '</h2>'); register_sidebar($args); //Content width if (!isset($content_width)) { $content_width = 900; } //Initiate custom post types add_action('init', 'renova_post_types'); add_action('init', 'renova_post_gallery'); //Load the text domain load_theme_textdomain('renovalang', get_template_directory() . '/languages'); //Post Thumbnails add_theme_support('post-thumbnails', array('portfolio_item', 'gallery_item', 'post')); //Post formats add_theme_support('post-formats', array('image', 'audio', 'link', 'quote', 'video')); set_post_thumbnail_size(300, 300, true); // Standard Size Thumbnails //Function to crop all thumbnails if (false === get_option("thumbnail_crop")) { add_option("thumbnail_crop", "1"); } else { update_option("thumbnail_crop", "1"); } }
/** * Flexy setup. * * Sets up theme defaults and registers the various WordPress features that * Flexy supports. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To add a Visual Editor stylesheet. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, * custom background, and post formats. * @uses register_nav_menu() To add support for navigation menus. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Flexy 1.0 */ function flexy_setup() { add_theme_support('title-tag'); // Set up the content width value based on the theme's design and stylesheet. if (!isset($content_width)) { global $content_width; $content_width = 625; } /* * Makes Flexy available for translation. * * Translations can be added to the /languages/ directory. * If you're building a theme based on Flexy , use a find and replace * to change 'flexy' to the name of your theme in all the template files. */ load_theme_textdomain('flexy', get_template_directory() . '/languages'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Adds RSS feed links to <head> for posts and comments. add_theme_support('automatic-feed-links'); // This theme supports a variety of post formats. add_theme_support('post-formats', array('aside', 'image', 'link', 'quote', 'status')); // This theme uses wp_nav_menu() in one location. register_nav_menu('primary', __('Primary Menu', 'flexy')); /* * This theme supports custom background color and image, * and here we also set up the default background color. */ add_theme_support('custom-background', array('default-color' => 'e6e6e6')); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support('post-thumbnails'); set_post_thumbnail_size(350, 350); // Unlimited height, soft crop }
function portfilo_portfolio_theme_setup() { add_theme_support('title-tag'); add_theme_support('custom-background'); $args = array('flex-width' => true, 'width' => 1400, 'flex-height' => true, 'height' => 600, 'default-image' => get_template_directory_uri() . '/images/overlay.jpg'); add_theme_support('custom-header', $args); /* --------------------------------------------------------------------------- * Loads Theme Textdomain * --------------------------------------------------------------------------- */ load_theme_textdomain('portfilo', PORTFILO_LANG_DIR); add_theme_support('automatic-feed-links'); add_theme_support('woocommerce'); add_theme_support('post-thumbnails'); set_post_thumbnail_size(260, 146, false); // admin - featured image add_image_size('portfilo_50x50', 50, 50, false); // admin - lists add_image_size('portfilo-aboutus-thumbnail', 1140, 640, true); add_image_size('portfilo-blog-listing-thumbnail', 458, 244, true); add_image_size('portfilo-blog-detail-thumbnail', 750, 400, true); add_image_size('portfilo-slider-thumbnail', 1400, 786, true); /* --------------------------------------------------------------------------- * Registers a menu location to use with navigation menus. * --------------------------------------------------------------------------- */ /*register_nav_menu('primary', __('Main menu', 'portfilo')); register_nav_menu('footer', __('Footer menu', 'portfilo'));*/ register_nav_menus(array('primary' => __('Primary Navigation', 'portfilo'), 'secondary' => __('Secondary Navigation', 'portfilo'))); add_action('add_meta_boxes', 'portfilo_Slider'); add_action('save_post', 'PortfiloSaveHomePageSlider'); }
/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. * * @since Starter Theme 1.0f */ function startertheme_setup() { /* Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support('title-tag'); /* * Enable support for Post Thumbnails on posts and pages. * */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(825, 510, true); /** * Register WP Nav Menu * This theme uses wp_nav_menu() in two locations. */ /** * */ register_nav_menus(array('main_menu' => __('Main Menu', 'startertheme'), 'footer_menu' => __('Footer Menu', 'startertheme'))); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); }
function lwfitness_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain('lwfitness', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); /* * Let WordPress manage the document title. */ add_theme_support('title-tag'); /* * Enable support for Post Thumbnails on posts and pages. */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(825, 510, true); // Add menus. register_nav_menus(array('primary' => __('Primary Menu', 'lwfitness'), 'social' => __('Social Links Menu', 'lwfitness'))); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); /* * Enable support for Post Formats. */ add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat')); }
function reef_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on twentyfifteen, use a find and replace * to change 'twentyfifteen' to the name of your theme in all the template files */ load_theme_textdomain('TEXTDOMAIN', get_template_directory() . '/languages'); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support('title-tag'); /* * Enable support for Post Thumbnails on posts and pages. * * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(200, 200, true); add_image_size('full-image', 1100, 1100); // add_image_size( 'big-image', 750, 750 ); // add_image_size( 'medium-image', 500, 500 ); add_image_size('small-image', 250, 250, true); add_image_size('panoramic-image', 800, 400, true); // This theme uses wp_nav_menu() in two locations. register_nav_menus(array('cat' => __('Category menu', 'TEXTDOMAIN'), 'langs' => __('Language menu', 'TEXTDOMAIN'))); }
/** * Setup */ function plandd_setup() { /** * Registrar formatos de miniaturas */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(242, 220, true); if (function_exists('add_image_size')) { add_image_size('destaque.grande', 960, 395, true); add_image_size('destaque.medio', 300, 187, true); add_image_size('destaque.pequeno', 140, 98, true); add_image_size('destaque.rodape', 300, 286, true); add_image_size('destaque.editoria', 300, 286, true); add_image_size('destaque.colunista', 80, 80, true); } function new_excerpt_length($length) { return 20; } add_filter('excerpt_length', 'new_excerpt_length'); remove_filter('the_excerpt', 'wpautop'); // sem paragrafo no resumo /** * Menus */ register_nav_menus(array('primary' => __('Menu principal', 'plandd'))); }
function blackoot_setup() { /* Translation support * Translations can be added to the /languages directory. * A .pot template file is included to get you started */ load_theme_textdomain('blackoot-lite', get_template_directory() . '/languages'); // Content Width global $content_width; if (!isset($content_width)) { $content_width = 680; } /* Feed links support */ add_theme_support('automatic-feed-links'); /* Register menus */ register_nav_menu('primary', 'Navigation menu'); register_nav_menu('footer-menu', 'Footer menu'); /* Title tag support */ add_theme_support('title-tag'); /* Post Thumbnails Support */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(680, 300, true); /* Custom header support */ add_theme_support('custom-header', array('header-text' => false, 'width' => 1000, 'height' => 364, 'flex-height' => true)); /* Custom background support */ add_theme_support('custom-background', array('default-color' => '111111', 'default-image' => get_template_directory_uri() . '/img/zwartevilt.png')); }
function _action_theme_setup() { /* * Make Theme available for translation. */ load_theme_textdomain('unyson', get_template_directory() . '/languages'); // This theme styles the visual editor to resemble the theme style. add_editor_style(array('css/editor-style.css', fw_theme_font_url())); // Add RSS feed links to <head> for posts and comments. add_theme_support('automatic-feed-links'); // Enable support for Post Thumbnails, and declare two sizes. add_theme_support('post-thumbnails'); set_post_thumbnail_size(811, 372, true); add_image_size('fw-theme-full-width', 1038, 576, true); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); /* * Enable support for Post Formats. * See http://codex.wordpress.org/Post_Formats */ add_theme_support('post-formats', array('aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery')); // Add support for featured content. add_theme_support('featured-content', array('featured_content_filter' => 'fw_theme_get_featured_posts', 'max_posts' => 6)); // This theme uses its own gallery styles. add_filter('use_default_gallery_style', '__return_false'); }
/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function graphy_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on Graphy, use a find and replace * to change 'graphy' to the name of your theme in all the template files */ load_theme_textdomain('graphy', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); /* * Switches default core markup for search form, comment form, * and comments to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list')); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(800); add_image_size('graphy-page-thumbnail', 1260, 350, true); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'graphy'))); // Enable support for Post Formats. add_theme_support('post-formats', array('aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video')); // Setup the WordPress core custom header feature. add_theme_support('custom-header', apply_filters('graphy_custom_header_args', array('default-image' => '', 'width' => 1260, 'height' => 350, 'flex-height' => false, 'header-text' => false))); // This theme styles the visual editor to resemble the theme style. add_editor_style(array('css/editor-style.css', graphy_fonts_url())); // This theme uses its own gallery styles. add_filter('use_default_gallery_style', '__return_false'); }
/** * GalaNight theme basic setup. * */ function galanight_setup() { // Makes GalaNight available for translation. load_theme_textdomain('galanight', get_template_directory() . '/languages'); // This theme styles the visual editor to resemble the theme style. $galanight_font_url = add_query_arg('family', 'Oswald', "//fonts.googleapis.com/css"); add_editor_style(array('editor-style.css', $galanight_font_url)); // Adds RSS feed links to <head> for posts and comments. add_theme_support('automatic-feed-links'); // This theme supports custom background color and image. $defaults = array('default-color' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => ''); add_theme_support('custom-background', $defaults); // This theme supports post thumbnails. add_theme_support('post-thumbnails'); set_post_thumbnail_size(1170, 9999); // This theme supports a custom header image. $args = array('width' => 1800, 'height' => 400, 'flex-width' => true, 'flex-height' => true, 'header-text' => false, 'random-default' => true); add_theme_support('custom-header', $args); // This theme supports the Title Tag feature. add_theme_support('title-tag'); // This theme supports the WooCommerce plugin. add_theme_support('woocommerce'); global $content_width; if (!isset($content_width)) { $content_width = 840; } }
function my_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses post thumbnails if (function_exists('add_theme_support')) { // Added in 2.9 add_theme_support('post-thumbnails'); set_post_thumbnail_size(230, 214, true); // Normal post thumbnails add_image_size('post-thumbnail-xl', 692, 300, true); // Portfolio Extra Large Thumbnail add_image_size('slider-post-thumbnail', 990, 424, true); // Slider Thumbnail add_image_size('small-post-thumbnail', 130, 121, true); // Small Thumbnail add_image_size('testi-thumbnail', 120, 120, true); // Testimonial Thumbnail add_image_size('extra-thumbnail', 150, 174, true); // Extra Thumbnail } // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // custom menu support add_theme_support('menus'); if (function_exists('register_nav_menus')) { register_nav_menus(array('header_menu' => 'Header Menu', 'footer_menu' => 'Footer Menu')); } }
function eminent_setup() { // This theme uses wp_nav_menu() in one locations. register_nav_menus(array('primary' => __('Main Menu', 'eminent'))); global $eminent_content_width; if (!isset($content_width)) { $content_width = 900; } /* * Make eminent theme available for translation. */ load_theme_textdomain('eminent', get_template_directory() . '/languages'); // This theme styles the visual editor to resemble the theme style. add_editor_style(array('css/editor-style.css', eminent_font_url())); // Add RSS feed links to <head> for posts and comments. add_theme_support('automatic-feed-links'); add_theme_support('title-tag'); add_theme_support('post-thumbnails'); set_post_thumbnail_size(770, 350, true); add_image_size('eminent-blog-thumbnail-image', 770, 400, true); add_image_size('eminent-blog-thumbnail-image-home', 370, 263, true); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list')); // Add support for featured content. add_theme_support('featured-content', array('featured_content_filter' => 'eminent_get_featured_posts', 'max_posts' => 6)); add_theme_support('custom-header', apply_filters('eminent_custom_header_args', array('uploads' => true, 'flex-height' => true, 'default-text-color' => '#e36229', 'header-text' => true, 'height' => '120', 'width' => '1260'))); add_theme_support('custom-background', apply_filters('eminent_custom_background_args', array('default-color' => 'f5f5f5'))); // This theme uses its own gallery styles. add_filter('use_default_gallery_style', '__return_false'); }
/** * Registers custom image sizes for the theme. * * @since 1.0.0 * @access public * @return void */ function stargazer_register_image_sizes() { /* Sets the 'post-thumbnail' size. */ set_post_thumbnail_size(175, 131, true); /* Adds the 'stargazer-full' image size. */ add_image_size('stargazer-full', 1025, 500, false); }
/** * Setup Origami. * * @action after_setup_theme */ function origami_setup() { so_settings_init(); global $content_width; if (!isset($content_width)) { $content_width = 904; } // Load the text domains load_theme_textdomain('origami', get_template_directory() . '/languages'); add_theme_support('automatic-feed-links'); // Origami supports post formats add_theme_support('post-formats', array('gallery', 'image', 'video', 'aside', 'link', 'quote', 'status', 'chat')); // Origami supports post thumbnails add_theme_support('post-thumbnails'); // Create the primary menu area register_nav_menu('primary', 'Primary Menu'); // Add support for custom backgrounds. add_theme_support('custom-background', array('default-color' => 'f0eeeb', 'default-image' => get_template_directory_uri() . '/images/bg.png')); // Use custom headers for site logo add_theme_support('custom-header', array('flex-height' => true, 'flex-width' => true, 'header-text' => false)); add_editor_style(); // Set up the image sizes set_post_thumbnail_size(904, 400, true); add_image_size('post-thumbnail-mobile', 480, 420, true); add_image_size('post-thumbnail-full', 904, 904, false); add_image_size('origami-slider', 904, 500, true); }
function nimbus_setup() { // Localization $lang_local = get_template_directory() . '/lang'; load_theme_textdomain('nimbus', $lang_local); // Register Thumbnail Sizes add_theme_support('post-thumbnails'); set_post_thumbnail_size(1170, 9999, true); add_image_size('nimbus_270_170', 270, 170, true); add_image_size('nimbus_740_420', 740, 420, true); add_image_size('nimbus_105_90', 105, 90, true); add_image_size('nimbus_1140_420', 1140, 420, true); add_image_size('nimbus_1130_410', 1130, 410, true); // Load feed links add_theme_support('automatic-feed-links'); // Support Custom Background $nimbus_custom_background_defaults = array('default-color' => 'ffffff'); add_theme_support('custom-background', $nimbus_custom_background_defaults); // Set Content Width global $content_width; if (!isset($content_width)) { $content_width = 720; } // Register Menus register_nav_menu('primary', __('Primary Menu', 'nimbus')); }
/** * Twenty Twelve setup. * * Sets up theme defaults and registers the various WordPress features that * Twenty Twelve supports. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To add a Visual Editor stylesheet. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, * custom background, and post formats. * @uses register_nav_menu() To add support for navigation menus. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Twenty Twelve 1.0 */ function twentytwelve_setup() { /* * Makes Twenty Twelve available for translation. * * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Twelve, use a find and replace * to change 'twentytwelve' to the name of your theme in all the template files. */ load_theme_textdomain('twentytwelve', get_template_directory() . '/languages'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Adds RSS feed links to <head> for posts and comments. add_theme_support('automatic-feed-links'); // This theme supports a variety of post formats. add_theme_support('post-formats', array('aside', 'image', 'link', 'quote', 'status')); // This theme uses wp_nav_menu() in one location. register_nav_menu('primary', __('Primary Menu', 'twentytwelve')); /* * This theme supports custom background color and image, * and here we also set up the default background color. */ add_theme_support('custom-background', array('default-color' => 'e6e6e6')); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support('post-thumbnails'); set_post_thumbnail_size(624, 9999); // Unlimited height, soft crop }
function my_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses post thumbnails if (function_exists('add_theme_support')) { // Added in 2.9 add_theme_support('post-thumbnails'); set_post_thumbnail_size(235, 148, true); // Normal post thumbnails add_image_size('post-thumbnail-xl', 578, 250, true); // Portfolio Extra Large Thumbnail add_image_size('portfolio-post-thumbnail', 268, 168, true); // Portfolio Thumbnail add_image_size('portfolio-post-thumbnail-small', 196, 148, true); // Portfolio Small Thumbnail add_image_size('portfolio-post-thumbnail-large', 417, 208, true); // Portfolio Large Thumbnail add_image_size('portfolio-post-thumbnail-xl', 498, 238, true); // Portfolio Extra Large Thumbnail add_image_size('small-post-thumbnail', 139, 139, true); // Small Thumbnail } // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // custom menu support add_theme_support('menus'); if (function_exists('register_nav_menus')) { register_nav_menus(array('header_menu' => 'Header Menu')); } }
function exclusive_setup() { add_theme_support('custom-header', array('default-image' => '', 'header-text' => false, 'wp-head-callback' => 'exclusive_header_style')); $exclusive_defaults = array('default-color' => 'E3E1E2', 'default-image' => '', 'admin-head-callback' => '', 'admin-preview-callback' => ''); add_theme_support('custom-background', $exclusive_defaults); if (!get_theme_mod('background_color', false)) { set_theme_mod('background_color', 'e3e1e2'); } add_theme_support('title-tag'); //Enable post and comments RSS feed links to head add_theme_support('automatic-feed-links'); // Enable post thumbnails add_theme_support('post-thumbnails'); set_post_thumbnail_size(150, 150); load_theme_textdomain('exclusive', get_template_directory() . '/languages'); add_editor_style(); global $exclusive_layout_page; foreach ($exclusive_layout_page->options_themeoptions as $value) { if (isset($value['id'])) { if (get_theme_mod($value['id']) === FALSE) { ${$value}['var_name'] = $value['std']; } else { ${$value}['var_name'] = get_theme_mod($value['id']); } } } global $content_width; if (!isset($content_width)) { $content_width = $content_area; } }
/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * @since untitled 1.0 */ function untitled_setup() { /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on untitled, use a find and replace * to change 'untitled' to the name of your theme in all the template files */ load_theme_textdomain('untitled', get_template_directory() . '/languages'); /** * Add default posts and comments RSS feed links to head */ add_theme_support('automatic-feed-links'); /** * Enable support for Post Thumbnails */ add_theme_support('post-thumbnails', array('post', 'page')); set_post_thumbnail_size(150, 150); add_image_size('slider-img', 1440, 400, true); add_image_size('content-img', 300, 168, true); add_image_size('thumbnail-img', 62, 62, true); add_image_size('feat-img', 1000); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus(array('primary' => __('Primary Menu', 'untitled'))); /** * Enable support for Post Formats */ add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link')); }
function sf_dante_setup() { /* THEME SUPPORT ================================================== */ add_theme_support('structured-post-formats', array('audio', 'gallery', 'image', 'link', 'video')); add_theme_support('post-formats', array('aside', 'chat', 'quote', 'status')); add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails'); add_theme_support('woocommerce'); /* THUMBNAIL SIZES ================================================== */ set_post_thumbnail_size(220, 150, true); add_image_size('widget-image', 94, 70, true); add_image_size('thumb-square', 250, 250, true); add_image_size('thumb-image', 600, 450, true); add_image_size('thumb-image-twocol', 900, 675, true); add_image_size('thumb-image-onecol', 1800, 1200, true); add_image_size('blog-image', 1280, 9999); add_image_size('full-width-image-gallery', 1280, 720, true); /* CONTENT WIDTH ================================================== */ if (!isset($content_width)) { $content_width = 1140; } /* LOAD THEME LANGUAGE ================================================== */ load_theme_textdomain('swiftframework', SF_TEMPLATE_PATH . '/language'); }
function nimbus_setup() { // Localization $lang_local = get_template_directory() . '/lang'; load_theme_textdomain('nimbus', $lang_local); // Register Thumbnail Sizes add_theme_support('post-thumbnails'); set_post_thumbnail_size(1160, 9999, true); add_image_size('nimbus-small', 140, 90, true); add_image_size('nimbus-feature', 370, 191, true); add_image_size('nimbus-post', 760, 227, true); add_image_size('nimbus-post-full', 1160, 221, true); add_image_size('full-banner', 1160, 360, true); add_image_size('half-banner', 660, 360, true); add_image_size('half-image', 670, 424, true); add_image_size('full-image', 1170, 424, true); // Load feed links add_theme_support('automatic-feed-links'); // Support Custom Background $nimbus_custom_background_defaults = array('default-color' => 'ffffff'); add_theme_support('custom-background', $nimbus_custom_background_defaults); // Set Content Width global $content_width; if (!isset($content_width)) { $content_width = 770; } // Register Menus register_nav_menu('primary', __('Primary Menu', 'nimbus')); register_nav_menu('mobile', __('Mobile Menu', 'nimbus')); }
function theme_setup() { /* This theme uses post thumbnails (aka "featured images") * all images will be cropped to thumbnail size (below), as well as * a square size (also below). You can add more of your own crop * sizes with add_image_size. */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(120, 90, true); add_image_size('square', 380, 380, true); add_image_size('small-square', 185, 185, true); add_image_size('half', 640, 640, true); add_image_size('post', 600, 600, true); add_image_size('about', 400, 566, true); add_image_size('single-post', 600, 600, true); // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); /* This theme uses wp_nav_menu() in one location. * You can allow clients to create multiple menus by * adding additional menus to the array. */ register_nav_menus(array('primary' => 'Primary Navigation')); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); }
/** * Registers custom image sizes for the theme. * * @since 1.0.0 * @access public * @return void */ function saga_register_image_sizes() { /* Sets the 'post-thumbnail' size. */ set_post_thumbnail_size(175, 119, true); /* Adds the 'saga-large' image size. */ add_image_size('saga-large', 1100, 9999, false); }
function _tm_register_image_sizes() { if (!current_theme_supports('post-thumbnails')) { return; } set_post_thumbnail_size(238, 182, true); // Registers a new image sizes. add_image_size('_tm-thumb-s', 150, 150, true); add_image_size('_tm-thumb-240-100', 240, 100, true); add_image_size('_tm-thumb-m', 400, 400, true); add_image_size('_tm-thumb-560-350', 560, 350, true); add_image_size('_tm-post-thumbnail-large', 770, 480, true); add_image_size('_tm-thumb-l', 1170, 780, true); add_image_size('_tm-thumb-xl', 1920, 1080, true); add_image_size('_tm-thumb-150-115', 150, 115, true); add_image_size('_tm-thumb-238-182', 238, 182, true); add_image_size('_tm-thumb-337-258', 337, 258, true); add_image_size('_tm-thumb-476-365', 476, 365, true); add_image_size('_tm-thumb-536-411', 536, 411, true); add_image_size('_tm-thumb-426-327', 426, 327, true); add_image_size('_tm-thumb-860-662', 860, 662, true); add_image_size('_tm-thumb-760-585', 760, 585, true); add_image_size('_tm-thumb-660-508', 660, 508, true); add_image_size('_tm-thumb-1132-411', 1132, 411, true); }
function selfie_setup() { // Theme TextDomain for the Language File load_theme_textdomain('selfie', get_template_directory() . '/languages'); // Theme Menus register_nav_menus(array('main-menu' => __('Main Menu', 'selfie'), 'top-menu' => __('Top Menu', 'selfie'))); // Set the content width based on the theme's design and stylesheet. global $content_width; if (!isset($content_width)) { $content_width = 584; } // Tell WordPress for the Feed Link add_theme_support('automatic-feed-links'); add_editor_style(); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images add_theme_support('post-thumbnails'); set_post_thumbnail_size(150, 150, true); // default Post Thumbnail dimensions (cropped) add_image_size('fpage-thumb', 1000, 500, true); // WordPress 3.4 Custom Background Support $selfie_custom_background = array('default-color' => 'FFFFFF', 'default-image' => ''); add_theme_support('custom-background', $selfie_custom_background); // WordPress 3.4 Custom Header Support $selfie_custom_header = array('default-image' => get_template_directory_uri() . '/images/logo.png', 'random-default' => false, 'width' => 300, 'height' => 90, 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '0a96d8', 'header-text' => false, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => ''); add_theme_support('custom-header', $selfie_custom_header); }
function my_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses post thumbnails if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9 add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 200, 150, true ); // Normal post thumbnails add_image_size( 'slider-post-thumbnail', 940, 446, true ); // Slider Thumbnail add_image_size( 'slider-thumb', 100, 50, true ); // Slider Small Thumbnail } // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // custom menu support add_theme_support( 'menus' ); if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'header_menu' => theme_locals("header_menu"), 'footer_menu' => theme_locals("footer_menu") ) ); } }
function makeclean_theme_setup() { $languages_folder = THEME_URL . '/languages'; load_theme_textdomain(KC_DOMAIN, $languages_folder); /* Tự động thêm link rss lên <head>*/ add_theme_support('automatic-feed-links'); /* Them post thumbnail để hiển thị ảnh đại diện bài viết*/ add_theme_support('post-thumbnail'); add_theme_support('post-formats', ['image', 'video', 'gallery']); add_theme_support('title-tag'); /* custom background */ add_theme_support('custom-background', ['default-color' => '#f8f8f8']); set_post_thumbnail_size(114, 114, true); register_nav_menus(['main_menu' => __('Main Menu', KC_DOMAIN), 'bottom_menu' => __('Footer Menu', KC_DOMAIN), 'top-menu' => __('Top Menu', KC_DOMAIN)]); $sidebar = ['name' => __('Main Sidebar', KC_DOMAIN), 'id' => 'main-sidebar', 'description' => __('Default sidebar', KC_DOMAIN), 'class' => 'main-sidebar', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>']; register_sidebar($sidebar); $sidebar = ['name' => __('Woocommerce Sidebar', KC_DOMAIN), 'id' => 'woo-sidebar', 'before_widget' => ' <aside id="%1$s" class="widget widget_search %2$s" >', 'after_widget' => '</aside>', 'description' => __('Woocommerce sidebar', KC_DOMAIN), 'class' => 'woo-sidebar', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>']; register_sidebar($sidebar); /** * Creates a sidebar * @param string|array Builds Sidebar based off of 'name' and 'id' values. */ $args = array('name' => __('Footer link 1', KC_DOMAIN), 'id' => 'footer-link-1', 'description' => '', 'class' => '', 'before_widget' => '<aside id="%1$s" class="%2$s col-md-3 col-sm-3 widget widget-link">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'); register_sidebar($args); $args = array('name' => __('Footer link 2', KC_DOMAIN), 'id' => 'footer-link-2', 'description' => '', 'class' => '', 'before_widget' => '<aside id="%1$s" class="%2$s col-md-3 col-sm-3 widget widget-link">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'); register_sidebar($args); $args = array('name' => __('Footer link 3', KC_DOMAIN), 'id' => 'footer-link-3', 'description' => '', 'class' => '', 'before_widget' => '<aside id="%1$s" class="%2$s col-md-2 col-sm-2 widget widget-link">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'); register_sidebar($args); $args = array('name' => __('Footer Form', KC_DOMAIN), 'id' => 'footer-form', 'description' => '', 'class' => '', 'before_widget' => '<aside id="%1$s" class="%2$s ol-md-4 col-sm-4 widget widget-calculator">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'); register_sidebar($args); }