/** * Initial setup for Magazine Basic theme * * This function is attached to the 'after_setup_theme' action hook. * * @uses load_theme_textdomain() * @uses get_locale() * @uses add_theme_support() * @uses add_editor_style() * @uses register_default_headers() * * @since 3.0.0 */ function bavotasan_setup() { $bavotasan_theme_options = bavotasan_theme_options(); load_theme_textdomain('magazine-basic', BAVOTASAN_THEME_TEMPLATE . '/library/languages'); // Add default posts and comments RSS feed links to <head>. add_theme_support('automatic-feed-links'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(array('library/css/admin/editor-style.css', bavotasan_font_url())); // This theme uses wp_nav_menu() in two locations. register_nav_menu('primary', __('Primary Menu', 'magazine-basic')); register_nav_menu('secondary', __('Secondary Menu', 'magazine-basic')); // Add support for a variety of post formats add_theme_support('post-formats', array('gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside')); // This theme uses Featured Images (also known as post thumbnails) for archive pages add_theme_support('post-thumbnails'); add_image_size('1_column', $bavotasan_theme_options['1_image_width'], 999); add_image_size('2_column', $bavotasan_theme_options['2_image_width'], 999); add_image_size('3_column', $bavotasan_theme_options['3_image_width'], 999); // Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header. add_theme_support('custom-header', array('random-default' => true, 'default-text-color' => '333', 'flex-width' => true, 'flex-height' => true, 'width' => apply_filters('bavotasan_header_image_width', 1200), 'height' => apply_filters('bavotasan_header_image_height', 288), 'admin-head-callback' => 'bavotasan_admin_header_style', 'admin-preview-callback' => 'bavotasan_admin_header_image')); add_theme_support('custom-background', array('default-image' => BAVOTASAN_THEME_URL . '/library/images/solid.png')); // Add HTML5 elements add_theme_support('html5', array('comment-list', 'search-form', 'comment-form')); // Add title tag support add_theme_support('title-tag'); // Remove default gallery styles add_filter('use_default_gallery_style', '__return_false'); }
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'); } load_theme_textdomain('wd_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; } }
/** * Set 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. * * To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's * functions.php file. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To style the visual editor. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers * and backgrounds, and post formats. * @uses register_nav_menus() To add support for navigation menus. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Twenty Eleven 1.0 */ function twentyeleven_setup() { /* * Make Twenty Eleven available for translation. * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Eleven, use * a find and replace to change 'twentyeleven' to the name * of your theme in all the template files. */ load_theme_textdomain('twentyeleven', get_template_directory() . '/languages'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Load up our theme options page and related code. require get_template_directory() . '/inc/theme-options.php'; // Grab Twenty Eleven's Ephemera widget. require get_template_directory() . '/inc/widgets.php'; // 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. register_nav_menu('primary', __('Primary Menu', 'twentyeleven')); // Add support for a variety of post formats add_theme_support('post-formats', array('aside', 'link', 'gallery', 'status', 'quote', 'image')); $theme_options = twentyeleven_get_theme_options(); if ('dark' == $theme_options['color_scheme']) { $default_background_color = '1d1d1d'; } else { $default_background_color = 'e2e2e2'; } // Add support for custom backgrounds. add_theme_support('custom-background', array('default-color' => $default_background_color)); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images add_theme_support('post-thumbnails'); // Add support for custom headers. $custom_header_support = array('default-text-color' => '000', 'width' => apply_filters('twentyeleven_header_image_width', 1000), 'height' => apply_filters('twentyeleven_header_image_height', 288), 'flex-height' => true, 'random-default' => true, 'wp-head-callback' => 'twentyeleven_header_style', 'admin-head-callback' => 'twentyeleven_admin_header_style', 'admin-preview-callback' => 'twentyeleven_admin_header_image'); add_theme_support('custom-header', $custom_header_support); if (!function_exists('get_custom_header')) { // This is all for compatibility with versions of WordPress prior to 3.4. define('HEADER_TEXTCOLOR', $custom_header_support['default-text-color']); define('HEADER_IMAGE', ''); define('HEADER_IMAGE_WIDTH', $custom_header_support['width']); define('HEADER_IMAGE_HEIGHT', $custom_header_support['height']); add_custom_image_header($custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback']); add_custom_background(); } /* * We'll be using post thumbnails for custom header images on posts and pages. * We want them to be the size of the header image that we just defined. * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. */ set_post_thumbnail_size($custom_header_support['width'], $custom_header_support['height'], true); /* * Add Twenty Eleven's custom image sizes. * Used for large feature (header) images. */ add_image_size('large-feature', $custom_header_support['width'], $custom_header_support['height'], true); // Used for featured posts if a large-feature doesn't exist. add_image_size('small-feature', 500, 300); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers(array('wheel' => array('url' => '%s/images/headers/wheel.jpg', 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg', 'description' => __('Wheel', 'twentyeleven')), 'shore' => array('url' => '%s/images/headers/shore.jpg', 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg', 'description' => __('Shore', 'twentyeleven')), 'trolley' => array('url' => '%s/images/headers/trolley.jpg', 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg', 'description' => __('Trolley', 'twentyeleven')), 'pine-cone' => array('url' => '%s/images/headers/pine-cone.jpg', 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg', 'description' => __('Pine Cone', 'twentyeleven')), 'chessboard' => array('url' => '%s/images/headers/chessboard.jpg', 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg', 'description' => __('Chessboard', 'twentyeleven')), 'lanterns' => array('url' => '%s/images/headers/lanterns.jpg', 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg', 'description' => __('Lanterns', 'twentyeleven')), 'willow' => array('url' => '%s/images/headers/willow.jpg', 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg', 'description' => __('Willow', 'twentyeleven')), 'hanoi' => array('url' => '%s/images/headers/hanoi.jpg', 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg', 'description' => __('Hanoi Plant', 'twentyeleven')))); }
/** * Set up theme defaults and register 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. */ function _tk_setup() { global $cap, $content_width; // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); /** * Add default posts and comments RSS feed links to head */ add_theme_support('automatic-feed-links'); /** * 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'); /** * Enable support for Post Formats */ add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link')); /** * Setup the WordPress core custom background feature. */ add_theme_support('custom-background', apply_filters('_tk_custom_background_args', array('default-color' => 'ffffff', 'default-image' => ''))); /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on _tk, use a find and replace * to change '_tk' to the name of your theme in all the template files */ load_theme_textdomain('_tk', get_template_directory() . '/languages'); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus(array('primary' => __('Header bottom menu', '_tk'))); }
/** * 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'); // 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')); }
function unity_night_ahoy() { //Allow editor style. add_editor_style(get_stylesheet_directory_uri() . '/library/css/editor-style.css'); // let's get language support going, if you need it load_theme_textdomain('unity-night', get_template_directory() . '/library/translation'); // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY require_once 'library/custom-post-type.php'; // launching operation cleanup add_action('init', 'unity_night_head_cleanup'); // A better title add_filter('wp_title', 'rw_title', 10, 3); // remove WP version from RSS add_filter('the_generator', 'unity_night_rss_version'); // remove pesky injected css for recent comments widget add_filter('wp_head', 'unity_night_remove_wp_widget_recent_comments_style', 1); // clean up comment styles in the head add_action('wp_head', 'unity_night_remove_recent_comments_style', 1); // clean up gallery output in wp add_filter('gallery_style', 'unity_night_gallery_style'); // enqueue base scripts and styles add_action('wp_enqueue_scripts', 'unity_night_scripts_and_styles', 999); // ie conditional wrapper // launching this stuff after theme setup unity_night_theme_support(); // adding sidebars to Wordpress (these are created in functions.php) add_action('widgets_init', 'unity_night_register_sidebars'); // cleaning up random code around images add_filter('the_content', 'unity_night_filter_ptags_on_images'); // cleaning up excerpt add_filter('excerpt_more', 'unity_night_excerpt_more'); }
/** * 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 goran_setup() { /* * Declare textdomain for this child theme. */ load_child_theme_textdomain('goran', get_stylesheet_directory() . '/languages'); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_image_size('edin-thumbnail-landscape', 314, 228, true); add_image_size('edin-thumbnail-square', 314, 314, true); add_image_size('edin-featured-image', 772, 9999); add_image_size('edin-hero', 1230, 1230); /* * Unregister nav menu. */ unregister_nav_menu('secondary'); /* * Editor styles. */ add_editor_style(array('editor-style.css', goran_noto_sans_font_url(), goran_noto_serif_font_url(), goran_droid_sans_mono_font_url())); /** * Add support for Eventbrite. * See: https://wordpress.org/plugins/eventbrite-api/ */ add_theme_support('eventbrite'); }
/** * 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 semifolio_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on Cartel, use a find and replace * to change 'semifolio' to the name of your theme in all the template files */ load_theme_textdomain('semifolio', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); // The title tag, only works on WordPress 4.1 or later add_theme_support('title-tag'); // Add stylesheet for the WYSIWYG editor add_editor_style(); /* * 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'); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'semifolio'), 'top-menu' => __('Top Menu', 'semifolio'))); // Enable support for Post Formats. //add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); // Custom backgrounds support $defaults_bg = array('default-color' => 'ffffff', 'default-image' => '', 'wp-head-callback' => 'semifolio_custom_background_cb', 'admin_head_callback' => '', 'admin_preview_callback' => ''); add_theme_support('custom-background', apply_filters('semifolio_custom_background_args', $defaults_bg)); // Custom header support $defaults_hd = array('default-text-color' => '', 'default-image' => '', 'upload' => true, 'wp-head-callback' => 'semifolio_header_style', 'admin_head_callback' => 'semifolio_admin_header_style', 'admin_preview_callback' => 'semifolio_admin_header_img'); add_theme_support('custom-header', apply_filters('semifolio_custom_header_args', $defaults_hd)); // Enable support for HTML5 markup. add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery', 'caption')); }
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')); } }
/** * Theme setup */ function xt_corporate_lite_setup() { // Make theme available for translation load_theme_textdomain('xt-corporate-lite', 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(array('primary_navigation' => __('Primary Navigation', 'xt-corporate-lite'))); register_nav_menus(array('footer_navigation' => __('Footer Navigation', 'xt-corporate-lite'))); // Add Feed Links add_theme_support('automatic-feed-links'); // Add 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'); // Add post formats // http://codex.wordpress.org/Post_Formats //add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']); // Add HTML5 markup for captions // http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5 add_theme_support('html5', array('caption', 'comment-form', 'comment-list')); // Add Custom Background Support add_theme_support("custom-background"); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style(get_template_directory_uri() . '/assets/css/editor-style.css'); }
/** * Initial setup * * This function is attached to the 'after_setup_theme' action hook. * * @uses load_theme_textdomain() * @uses get_locale() * @uses BAVOTASAN_THEME_TEMPLATE * @uses add_theme_support() * @uses add_editor_style() * @uses add_custom_background() * @uses add_custom_image_header() * @uses register_default_headers() * * @since 1.0.0 */ function bavotasan_setup() { load_theme_textdomain('tienda', BAVOTASAN_THEME_TEMPLATE . '/library/languages'); // Add default posts and comments RSS feed links to <head>. add_theme_support('automatic-feed-links'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style('library/css/admin/editor-style.css'); // This theme uses wp_nav_menu() in three location. register_nav_menu('primary', __('Primary Menu', 'tienda')); register_nav_menu('top', __('Top Menu', 'tienda')); // Add support for a variety of post formats add_theme_support('post-formats', array('gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside')); // This theme uses Featured Images (also known as post thumbnails) for archive pages add_theme_support('post-thumbnails', array('post', 'product')); add_image_size('featured-img', 840, 410, true); // Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header. add_theme_support('custom-header', array('header-text' => false, 'flex-height' => true, 'flex-width' => true, 'random-default' => true, 'width' => apply_filters('bavotasan_header_image_width', 1800), 'height' => apply_filters('bavotasan_header_image_height', 600))); // Add support for custom backgrounds add_theme_support('custom-background', array('default-color' => 'ffffff')); // Add HTML5 elements add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); // Add title tag support add_theme_support('title-tag'); // Remove default gallery styles add_filter('use_default_gallery_style', '__return_false'); // Add Woocommerce support add_theme_support('woocommerce'); }
/** * Run the Engine */ function calibrefx_initializing() { global $calibrefx; $calibrefx = Calibrefx::get_instance(); // Add theme support add_theme_support('html5', array('comment-list', 'comment-form', 'search-form')); add_theme_support('menus'); add_theme_support('title-tag'); add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails'); add_theme_support('post-formats', array('aside', 'status', 'image', 'video', 'audio', 'quote', 'link', 'gallery', 'chat')); if (is_child_theme()) { add_filter('calibrefx_helpers_to_include', 'childfx_load_extension', 10, 2); add_filter('calibrefx_shortcodes_to_include', 'childfx_load_extension', 15, 2); add_filter('calibrefx_hooks_to_include', 'childfx_load_extension', 20, 2); add_filter('calibrefx_widgets_to_include', 'childfx_load_extension', 25, 2); add_filter('calibrefx_library_path', 'childfx_load_library'); } //Load every active module Calibrefx::load_modules(); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ add_editor_style(array('assets/css/editor-style.css', 'assets/css/cfxicons.css', 'assets/css/font-awesome.css', 'assets/css/genericons.css', calibrefx_fonts_url())); // Run the engine $calibrefx->run(); /** Run the calibrefx_post_init hook */ do_action('calibrefx_post_init'); }
function salejunction_setup() { global $wpdb; add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails'); add_image_size('index-categories', 200, 150, true); add_image_size('page-single', 600, 600, true); add_editor_style(); register_nav_menu('custom_menu', MAIN_MENU); //Load languages file load_theme_textdomain('salejunction', get_template_directory() . '/languages'); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/{$locale}.php"; if (is_readable($locale_file)) { require_once $locale_file; } /** * Set the content width based on the theme's design and stylesheet. * * Used to set the width of images and content. Should be equal to the width the theme * is designed for, generally via the style.css stylesheet. */ global $content_width; if (!isset($content_width)) { $content_width = 590; } }
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'); }
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; } }
function danhuaer_setup() { add_editor_style(); add_theme_support('post-thumbnails'); add_theme_support('automatic-feed-links'); load_theme_textdomain('danhuaer', get_template_directory() . '/languages'); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/{$locale}.php"; if (is_readable($locale_file)) { require_once $locale_file; } register_nav_menus(array('primary' => __('Primary Navigation', 'danhuaer'))); add_custom_background(); if (!defined('HEADER_TEXTCOLOR')) { define('HEADER_TEXTCOLOR', ''); } // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI. if (!defined('HEADER_IMAGE')) { define('HEADER_IMAGE', '%s/i/headers/home-banner.jpg'); } // The height and width of your custom header. You can hook into the theme's own filters to change these values. // Add a filter to danhuaer_header_image_width and danhuaer_header_image_height to change these values. define('HEADER_IMAGE_WIDTH', apply_filters('danhuaer_header_image_width', 1440)); define('HEADER_IMAGE_HEIGHT', apply_filters('danhuaer_header_image_height', 198)); // Don't support text inside the header image. if (!defined('NO_HEADER_TEXT')) { define('NO_HEADER_TEXT', true); } // Add a way for the custom header to be styled in the admin panel that controls // custom headers. See danhuaer_admin_header_style(), below. add_custom_image_header('', 'danhuaer_admin_header_style'); // ... and thus ends the changeable header business. // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers(array('berries' => array('url' => '%s/i/headers/neihan-banner.jpg', 'thumbnail_url' => '%s/i/headers/neihan-banner.jpg', 'description' => __('Berries', 'danhuaer')), 'path' => array('url' => '%s/i/headers/home-banner.jpg', 'thumbnail_url' => '%s/i/headers/home-banner.jpg', 'description' => __('Path', 'danhuaer')))); }
/** * 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 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 themeInit() { // allow editor style add_editor_style(get_stylesheet_directory_uri() . '/library/css/editor-style.css'); // let's get language support going, if you need it load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation'); // a better title (library/bones.php) add_filter('wp_title', 'rw_title', 10, 3); // remove wp version from rss (library/bones.php) add_filter('the_generator', 'bones_rss_version'); // remove pesky injected css for recent comments widget (library/bones.php) add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1); // clean up comment styles in the head (library/bones.php) add_action('wp_head', 'bones_remove_recent_comments_style', 1); // clean up gallery output in wp (library/bones.php) add_filter('gallery_style', 'bones_gallery_style'); // launching this stuff after theme setup (library/bones.php) bones_theme_support(); // cleaning up random code around images add_filter('the_content', 'bones_filter_ptags_on_images'); // cleaning up excerpt add_filter('excerpt_more', 'bones_excerpt_more'); // add filter to prevent "slack.png" from occupying the "slack" slug add_filter('wp_unique_post_slug_is_bad_attachment_slug', '__return_true'); }
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'); }
/** * 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 eryn_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on eryn, use a find and replace * to change 'eryn' to the name of your theme in all the template files */ load_theme_textdomain('eryn', get_template_directory() . '/languages'); // Feed Links add_theme_support('automatic-feed-links'); // Post formats add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery')); // Post thumbnails add_theme_support('post-thumbnails'); add_image_size('full-thumb', 940, 0, true); add_image_size('slider-thumb', 650, 440, true); add_image_size('thumb', 440, 294, true); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'eryn'))); /* * 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')); // Display Title in theme add_theme_support('title-tag'); // Custom Backgrounds Support $args = array('default-color' => 'FFFFFF'); add_theme_support('custom-background', $args); // link a custom stylesheet file to the TinyMCE visual editor $font_url = str_replace(',', '%2C', '//fonts.googleapis.com/css?family=Droid+Serif'); add_editor_style(array('style.css', 'css/editor-style.css', $font_url)); }
/** * 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); }
/** * Theme setup */ function setup() { // Make theme available for translation // Community translations can be found at https://github.com/roots/rubi-translations load_theme_textdomain('rubi', 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', 'rubi')]); // Add 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'); // Add post formats // http://codex.wordpress.org/Post_Formats add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']); // Add HTML5 markup for captions // http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5 add_theme_support('html5', ['caption', 'comment-form', 'comment-list']); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style(Assets\asset_path('styles/editor-style.css')); }
/** * Sets up theme defaults and registers support for various WordPress and BuddyPress 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. * * To override bp_dtheme_setup() in a child theme, add your own bp_dtheme_setup to your child theme's * functions.php file. * * @global BuddyPress $bp The one true BuddyPress instance * @since BuddyPress (1.5) */ function bp_dtheme_setup() { // Load the AJAX functions for the theme require get_template_directory() . '/_inc/ajax.php'; // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme comes with all the BuddyPress goodies add_theme_support('buddypress'); // This theme uses post thumbnails add_theme_support('post-thumbnails'); // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // Add responsive layout support to bp-default without forcing child // themes to inherit it if they don't want to add_theme_support('bp-default-responsive'); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Navigation', 'buddypress'))); // This theme allows users to set a custom background $custom_background_args = array('wp-head-callback' => 'bp_dtheme_custom_background_style'); add_theme_support('custom-background', $custom_background_args); // Add custom header support if allowed if (!defined('BP_DTHEME_DISABLE_CUSTOM_HEADER')) { define('HEADER_TEXTCOLOR', 'FFFFFF'); // The height and width of your custom header. You can hook into the theme's own filters to change these values. // Add a filter to bp_dtheme_header_image_width and bp_dtheme_header_image_height to change these values. define('HEADER_IMAGE_WIDTH', apply_filters('bp_dtheme_header_image_width', 1250)); define('HEADER_IMAGE_HEIGHT', apply_filters('bp_dtheme_header_image_height', 133)); // We'll be using post thumbnails for custom header images on posts and pages. We want them to be 1250 pixels wide by 133 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true); // Add a way for the custom header to be styled in the admin panel that controls custom headers. $custom_header_args = array('wp-head-callback' => 'bp_dtheme_header_style', 'admin-head-callback' => 'bp_dtheme_admin_header_style'); add_theme_support('custom-header', $custom_header_args); } if (!is_admin() || defined('DOING_AJAX') && DOING_AJAX) { // Register buttons for the relevant component templates // Friends button if (bp_is_active('friends')) { add_action('bp_member_header_actions', 'bp_add_friend_button', 5); } // Activity button if (bp_is_active('activity') && bp_activity_do_mentions()) { add_action('bp_member_header_actions', 'bp_send_public_message_button', 20); } // Messages button if (bp_is_active('messages')) { add_action('bp_member_header_actions', 'bp_send_private_message_button', 20); } // Group buttons if (bp_is_active('groups')) { add_action('bp_group_header_actions', 'bp_group_join_button', 5); add_action('bp_group_header_actions', 'bp_group_new_topic_button', 20); add_action('bp_directory_groups_actions', 'bp_group_join_button'); } // Blog button if (bp_is_active('blogs')) { add_action('bp_directory_blogs_actions', 'bp_blogs_visit_blog_button'); } } }
/** * Initial setup * * This function is attached to the 'after_setup_theme' action hook. * * @uses load_theme_textdomain() * @uses get_locale() * @uses BAVOTASAN_THEME_TEMPLATE * @uses add_theme_support() * @uses add_editor_style() * @uses add_custom_background() * @uses add_custom_image_header() * @uses register_default_headers() * * @since 1.0.0 */ function bavotasan_setup() { load_theme_textdomain('arcade', BAVOTASAN_THEME_TEMPLATE . '/library/languages'); // Add default posts and comments RSS feed links to <head>. add_theme_support('automatic-feed-links'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style('library/css/admin/editor-style.css'); // This theme uses wp_nav_menu() in two location. register_nav_menu('primary', __('Primary Menu', 'arcade')); // Add support for a variety of post formats add_theme_support('post-formats', array('gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside')); // This theme uses Featured Images (also known as post thumbnails) for archive pages add_theme_support('post-thumbnails'); add_image_size('half', 570, 220, true); add_image_size('square100', 100, 100, true); // Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header. add_theme_support('custom-header', array('header-text' => false, 'flex-height' => true, 'flex-width' => true, 'random-default' => true, 'width' => apply_filters('bavotasan_header_image_width', 1800), 'height' => apply_filters('bavotasan_header_image_height', 1200))); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers(array('header01' => array('url' => '%s/library/images/header01.jpg', 'thumbnail_url' => '%s/library/images/header01-thumbnail.jpg', 'description' => __('Default Header 1', 'arcade')))); // Add support for custom backgrounds add_theme_support('custom-background'); // Add HTML5 elements add_theme_support('html5', array('comment-list', 'comment-form')); // Add title tag support add_theme_support('title-tag'); // Remove default gallery styles add_filter('use_default_gallery_style', '__return_false'); // Infinite scroll add_theme_support('infinite-scroll', array('type' => 'scroll', 'container' => 'primary', 'wrapper' => false, 'footer' => false)); // Add Woocommerce support add_theme_support('woocommerce'); }
/** * 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. * * To override foghorn_setup() in a child theme, add your own foghorn_setup to your child theme's * functions.php file. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To style the visual editor. * @uses add_theme_support() To add support for post thumbnails and automatic feed links. * @uses register_nav_menus() To add support for navigation menus. * @uses add_custom_background() To add support for a custom background. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Foghorn 0.1 */ function foghorn_setup() { /** * Set the content width based on the theme's design and stylesheet. */ if (!isset($content_width)) { $content_width = 560; } // Make Foghorn translatable load_theme_textdomain('foghorn', TEMPLATEPATH . '/languages'); $locale = get_locale(); $locale_file = TEMPLATEPATH . "/languages/{$locale}.php"; if (is_readable($locale_file)) { require_once $locale_file; } // Styles the visual editor with editor-style.css to match the theme style add_editor_style(); // 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. register_nav_menu('primary', __('Primary Menu', 'foghorn')); // Adds support for custom backgrounds add_custom_background(); // Adds theme support for thumbnails add_theme_support('post-thumbnails'); // Creates an image thumbnail size for multiple displays add_image_size('multiple-thumb', 325, 205, true); // Sets up the option panel functions require_once TEMPLATEPATH . '/extensions/options-functions.php'; }
/** * 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. */ function omega_theme_setup() { //remove_theme_mods(); /* Load omega functions */ require get_template_directory() . '/lib/functions/hooks.php'; add_theme_support('title-tag'); /* Load scripts. */ add_theme_support('omega-scripts', array('comment-reply')); add_theme_support('post-thumbnails'); add_theme_support('omega-theme-settings'); add_theme_support('omega-content-archives'); /* implement editor styling, so as to make the editor content match the resulting post output in the theme. */ add_editor_style(); /* Support pagination instead of prev/next links. */ add_theme_support('loop-pagination'); /* Add default posts and comments RSS feed links to <head>. */ add_theme_support('automatic-feed-links'); /* Enable wraps */ add_theme_support('omega-wraps'); /* Enable custom post */ add_theme_support('omega-custom-post'); /* Enable custom css */ add_theme_support('omega-custom-css'); /* Enable custom logo */ add_theme_support('omega-custom-logo'); /* Enable child themes page */ add_theme_support('omega-child-page'); /* Handle content width for embeds and images. */ omega_set_content_width(700); }
/** * 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( 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") ) ); } }
/** * 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'); }