function solofolio_theme_setup() { add_theme_support('post-thumbnails'); add_theme_support('automatic-feed-links'); add_theme_support('woocommerce'); add_theme_support('title-tag'); add_theme_support('html5', array('caption')); add_post_type_support('page', 'excerpt'); // Disable image linking by default update_option('image_default_link_type', 'none'); // Add additional image size for large displays, change defaults for others. add_image_size('xlarge', 1800, 1200, false); update_option('thumbnail_size_w', 10000); update_option('thumbnail_size_h', 200); update_option('medium_size_w', 600); update_option('medium_size_h', 400); update_option('large_size_w', 900); update_option('large_size_h', 600); # Disable thumbnail cropping if (false === get_option("thumbnail_crop")) { add_option("thumbnail_crop", "0"); } else { update_option("thumbnail_crop", "0"); } }
function custom_wordpress_setup() { // Enable tags for Pages (@see: https://wordpress.org/support/topic/enable-tags-screen-for-pages#post-29500520 //register_taxonomy_for_object_type('post_tag', 'page'); // Enable excerpts for pages add_post_type_support('page', 'excerpt'); }
/** * Constructor. * @since 1.1.0 */ public function __construct() { add_filter('woo_conditions', array(&$this, 'register_conditions')); add_filter('woo_conditions_headings', array(&$this, 'register_conditions_headings')); add_filter('woo_conditions_reference', array(&$this, 'register_conditions_reference')); add_post_type_support('product', 'woosidebars'); }
/** * Call add_post_type_support('{post-type}', 'fw-page-builder') * for post types checked on Page Builder Settings page. */ function _action_fw_ext_page_builder_add_support() { $feature_name = fw_ext('page-builder')->get_supports_feature_name(); foreach (array_keys(fw_get_db_ext_settings_option('page-builder', 'post_types')) as $slug) { add_post_type_support($slug, $feature_name); } }
function mighty_theme_setup() { /* Register WP3+ menus */ register_nav_menu('header-menu', __('Header Menu', 'mighty')); register_nav_menu('footer-menu', __('Footer Menu', 'mighty')); /* Configure WP 2.9+ thumbnails */ add_theme_support('post-thumbnails'); add_image_size('s', 300, 300, true); add_image_size('m', 640, '', true); add_image_size('l', 980, '', true); update_option('thumbnail_size_w', 80); update_option('thumbnail_size_h', 80); update_option('thumbnail_crop', 1); // add_theme_support( // 'post-formats', // array( // 'gallery', // 'link', // 'quote', // 'video', // 'audio' // ) // ); add_theme_support('automatic-feed-links'); add_post_type_support('page', 'excerpt'); }
function __construct() { add_theme_support('post-formats'); add_theme_support('post-thumbnails'); add_theme_support('menus'); add_theme_support('title-tag'); add_filter('timber_context', array($this, 'add_user_nav_info_to_context')); add_filter('get_twig', array($this, 'add_to_twig')); add_filter('xv_planeta_feed', '__return_true'); add_filter('wpseo_twitter_creator_account', function ($twitter) { return '@softcatala'; }); add_action('init', array($this, 'register_post_types')); add_action('init', array($this, 'sc_rewrite_search')); add_action('template_redirect', array($this, 'sc_change_programs_search_url_rewrite')); add_action('init', array($this, 'sc_author_rewrite_base')); add_action('template_redirect', array($this, 'fix_woosidebar_hooks'), 1); add_action('template_redirect', array($this, 'sc_change_search_url_rewrite')); add_action('after_setup_theme', array($this, 'include_theme_conf')); //SC Dashboard settings add_action('admin_menu', array($this, 'include_sc_settings')); spl_autoload_register(array($this, 'autoload')); add_post_type_support('programa', 'woosidebars'); parent::__construct(); }
public function init() { /** * Can be used to prevent SEO tools from inserting custom meta tags. * * @module seo-tools * * @since 4.4.0 * * @param bool true Should Jetpack's SEO Meta Tags be enabled. Defaults to true. */ if (apply_filters('jetpack_seo_meta_tags_enabled', true)) { add_action('wp_head', array($this, 'meta_tags')); // Add support for editing page excerpts in pages, regardless of theme support. add_post_type_support('page', 'excerpt'); } /** * Can be used to prevent SEO tools form modifying site titles. * * @module seo-tools * * @since 4.4.0 * * @param bool true Should Jetpack SEO modify site titles. Defaults to true. */ if (apply_filters('jetpack_seo_custom_titles', true)) { // Overwrite page title with custom SEO meta title for themes that support title-tag. add_filter('pre_get_document_title', array('Jetpack_SEO_Titles', 'get_custom_title')); // Add overwrite support for themes that don't support title-tag. add_filter('wp_title', array('Jetpack_SEO_Titles', 'get_custom_title')); } add_filter('jetpack_open_graph_tags', array($this, 'set_custom_og_tags')); }
function __construct() { $this->pluginURI = plugin_dir_url(__FILE__); $this->pluginPATH = plugin_dir_path(__FILE__); add_action('wp_enqueue_scripts', array(&$this, 'veuse_uikit_enqueue_styles'), 0); add_action('admin_enqueue_scripts', array(&$this, 'veuse_uikit_enqueue_admin_script')); add_action('plugins_loaded', array(&$this, 'veuse_uikit_load_textdomain')); add_action('admin_head', array(&$this, 'widgets_admin_page'), 100); /* Include widgets */ require 'shortcodes.php'; /* Include widgets */ require 'widgets/page-widget.php'; require 'widgets/image-widget-2.php'; //require 'widgets/parallax-widget.php'; // Beta require 'widgets/download-widget.php'; require 'widgets/divider-widget.php'; require 'widgets/callout-widget.php'; require 'widgets/toggle-widget.php'; require 'widgets/tab-widget.php'; require 'widgets/verticaltab-widget.php'; require 'widgets/alert-widget.php'; require 'widgets/button-widget.php'; require 'widgets/iconbox-widget.php'; require 'widgets/testimonial-widget.php'; require 'widgets/postslider-widget.php'; require 'widgets/posts-widget.php'; require 'widgets/posts-grid-widget.php'; require 'widgets/progressbar-widget.php'; /* Add theme support */ add_post_type_support('page', 'excerpt'); }
/** * Adds Custom Field support to the Edit Media screen. * Declared public because it is an action. * * @since 0.80 * * @return void echoes the HTML markup for the label and value */ public static function mla_admin_init_action() { static $mc_att_category_metabox = array(); /* * Enable the enhanced "Media Categories" searchable metaboxes for hiearchical taxonomies */ if (class_exists('Media_Categories') && ('checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_CATEGORY_METABOX) || 'checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_TAG_METABOX))) { $taxonomies = get_taxonomies(array('show_ui' => true), 'objects'); foreach ($taxonomies as $key => $value) { if (MLAOptions::mla_taxonomy_support($key)) { if ($value->hierarchical) { if ('checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_CATEGORY_METABOX)) { $mc_att_category_metabox[] = new Media_Categories($key); } } else { if ('checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_TAG_METABOX)) { $mc_att_category_metabox[] = new Media_Categories($key); } } // flat } // is supported } // foreach } // class_exists add_post_type_support('attachment', 'custom-fields'); }
function spacious_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain('spacious', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page. add_theme_support('post-thumbnails'); // Supporting title tag via add_theme_support (since WordPress 4.1) add_theme_support('title-tag'); // Registering navigation menus. register_nav_menus(array('primary' => __('Primary Menu', 'spacious'), 'footer' => __('Footer Menu', 'spacious'))); // Cropping the images to different sizes to be used in the theme add_image_size('featured-blog-large', 750, 350, true); add_image_size('featured-blog-medium', 270, 270, true); add_image_size('featured', 642, 300, true); add_image_size('featured-blog-medium-small', 230, 230, true); // Setup the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('spacious_custom_background_args', array('default-color' => 'eaeaea'))); // Adding excerpt option box for pages as well add_post_type_support('page', 'excerpt'); /* * 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')); }
/** * Alfath initial setup and constants */ function alfath_setup() { // Make theme available for translation load_theme_textdomain('alfath', get_template_directory() . '/lang'); // Register wp_nav_menu() menus (http://codex.wordpress.org/Function_Reference/register_nav_menus) register_nav_menus(array('primary_navigation' => __('Primary Navigation', 'alfath'))); register_nav_menus(array('before_mobile_navigation' => __('Before Mobile Navigation', 'alfath'))); register_nav_menus(array('mobile_navigation' => __('Mobile Navigation', 'alfath'))); register_nav_menus(array('fixed_left_navigation' => __('Fixed Left Navigation', 'alfath'))); register_nav_menus(array('footer_navigation' => __('Footer Navigation', 'alfath'))); // Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails) add_theme_support('post-thumbnails'); add_image_size('bottom-thumbnail', 330); add_image_size('slide-image', 1140, 431); add_image_size('slide-image2', 665, 385, true, array('left', 'top')); add_image_size('slide-thumbnail', 150, 75, true); add_image_size('post-thumbnail', 750, 9999); add_image_size('sticky-thumbnail', 370, 247, true); add_image_size('regular-thumbnail', 300, 185, true); update_option('thumbnail_size_w', 150); update_option('thumbnail_size_h', 75); set_post_thumbnail_size(750, 9999, false); add_post_type_support('page', 'excerpt'); // add_image_size('category-thumb', 300, 9999); // 300px wide (and unlimited height) // Add post formats (http://codex.wordpress.org/Post_Formats) // add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat')); add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat')); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style('/assets/css/editor-style.css'); }
/** * Set up global settings for the blogs component. * * The BP_BLOGS_SLUG constant is deprecated, and only used here for * backwards compatibility. * * @since BuddyPress (1.5.0) * * @see BP_Component::setup_globals() for description of parameters. * * @param array $args See {@link BP_Component::setup_globals()}. */ public function setup_globals($args = array()) { $bp = buddypress(); if (!defined('BP_BLOGS_SLUG')) { define('BP_BLOGS_SLUG', $this->id); } // Global tables for messaging component $global_tables = array('table_name' => $bp->table_prefix . 'bp_user_blogs', 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta'); $meta_tables = array('blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta'); // All globals for blogs component. $args = array('slug' => BP_BLOGS_SLUG, 'root_slug' => isset($bp->pages->blogs->slug) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG, 'has_directory' => is_multisite(), 'notification_callback' => 'bp_blogs_format_notifications', 'search_string' => __('Search sites...', 'buddypress'), 'autocomplete_all' => defined('BP_MESSAGES_AUTOCOMPLETE_ALL'), 'global_tables' => $global_tables, 'meta_tables' => $meta_tables); // Setup the globals parent::setup_globals($args); /* * Set up the post post type to track. * * In case the config is not multisite, the blog_public option is ignored. */ if (0 !== apply_filters('bp_is_blog_public', (int) get_option('blog_public')) || !is_multisite()) { /** * Filters the post types to track for the Blog component. * * @since BuddyPress (1.5.0) * * @param array $value Array of post types to track. */ $post_types = apply_filters('bp_blogs_record_post_post_types', array('post')); foreach ($post_types as $post_type) { add_post_type_support($post_type, 'buddypress-activity'); } } // Filter the generic track parameters for the 'post' post type. add_filter('bp_activity_get_post_type_tracking_args', array($this, 'post_tracking_args'), 10, 2); }
function cuvey_setup() { global $cuvey_options; // Translations support. Find language files in cuvey/languages load_theme_textdomain('cuvey', 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 content width global $content_width; if (!isset($content_width)) { $content_width = 720; } // Editor style (editor-style.css) add_editor_style(array('assets/css/editor-style.css')); // Load plugin checker require get_template_directory() . '/inc/plugin-activation.php'; //Include all post types require get_template_directory() . '/inc/metabox.php'; // Nav Menu (Custom menu support) if (function_exists('register_nav_menu')) { global $cuvey_options; register_nav_menu('primary', __('cuvey Primary Menu', 'cuvey')); } // Theme Features: Automatic Feed Links add_theme_support('automatic-feed-links'); // Theme Features: Dynamic Sidebar add_post_type_support('post', 'simple-page-sidebars'); // Theme Features: Post Thumbnails and custom image sizes for post-thumbnails add_theme_support('post-thumbnails', array('post', 'page', 'product', 'portfolio', 'team', 'event', 'menu')); // Theme Features: Post Formats add_theme_support('post-formats', array('gallery', 'image', 'link', 'quote', 'video', 'audio')); }
function freedom_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain('freedom', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page. add_theme_support('post-thumbnails'); // Supporting title tag via add_theme_support (since WordPress 4.1) add_theme_support('title-tag'); // Registering navigation menu. register_nav_menu('primary', 'Primary Menu'); // Cropping the images to different sizes to be used in the theme add_image_size('featured', 660, 300, true); add_image_size('featured-home', 485, 400, true); // Setup the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('freedom_custom_background_args', array('default-color' => 'eaeaea'))); // Enable support for Post Formats. add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'chat', 'audio', 'status')); // Adding excerpt option box for pages as well add_post_type_support('page', 'excerpt'); /* * 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 custom_theme_setup() { add_theme_support('automatic-feed-links'); add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); add_post_type_support('page', array('excerpt')); add_theme_support('post-thumbnails'); }
function lucy_theme_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on BuildPress, use a find and replace */ load_theme_textdomain('lucy', get_template_directory() . '/lang'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); // Custom Backgrounds add_theme_support('custom-background', array('default-color' => 'ffffff')); /** * 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(150, 150, true); add_image_size('lucy-news-box', 274, 207, true); add_image_size('lucy-portfolio-box', 230, 230, true); // Menus add_theme_support('menus'); register_nav_menu('main-menu', _x('Main Menu', 'backend', 'lucy')); // Add theme support for Semantic Markup add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); // add excerpt support for pages add_post_type_support('page', 'excerpt'); // Add CSS for the TinyMCE editor add_editor_style(); }
function ht_theme_setup() { global $content_width; /* Set the $content_width for things such as video embeds. */ if (!isset($content_width)) { $content_width = 920; } /* Add theme support for automatic feed links. */ add_theme_support('automatic-feed-links'); /* Add theme support for post thumbnails (featured images). */ add_theme_support('post-thumbnails', array('post', 'slideshow', 'portfolio', 'product')); /* Add theme support for post formats */ add_theme_support('post-formats', array('link', 'quote', 'video', 'audio')); /* Add nav menus */ add_action('init', 'ht_register_menus'); /* Add sidebars */ add_action('widgets_init', 'ht_register_sidebars'); /* Load JavaScript files */ add_action('wp_enqueue_scripts', 'ht_scripts_styles'); /* Add excerpt to page */ add_post_type_support('page', 'excerpt'); /* * change the default.po file with poedit to create .mo file * The .mo file must be named based on the locale exactly. */ load_theme_textdomain('highthemes', get_template_directory() . '/languages'); }
/** * Set up theme defaults and registers support for various WordPress features. * * @since 1.0.0 */ function shrake_setup() { // Add support for translating strings in this theme. // @link http://codex.wordpress.org/Function_Reference/load_theme_textdomain load_theme_textdomain('shrake', get_template_directory() . '/languages'); // This theme styles the visual editor to resemble the theme style. add_editor_style(array(is_rtl() ? 'assets/css/editor-style-rtl.css' : 'assets/css/editor-style.css', shrake_fonts_url(), shrake_fonts_icon_url())); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); // Add support for the title tag. // @link https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ add_theme_support('title-tag'); // Add support for a logo. add_theme_support('site-logo', array('size' => 'medium')); // Add support for post thumbnails. add_theme_support('post-thumbnails'); add_image_size('shrake-featured', 1280, 600, array('center', 'top')); set_post_thumbnail_size(320, 9999); // Add support for Custom Background functionality. add_theme_support('custom-background', apply_filters('shrake_custom_background_args', array('default-color' => 'ffffff'))); // Add support for HTML5 markup. add_theme_support('html5', array('caption', 'comment-form', 'comment-list', 'gallery', 'search-form')); // Add support for Post Formats. add_theme_support('post-formats', array('aside', 'link', 'quote')); // Add support for page excerpts. add_post_type_support('page', 'excerpt'); // Register default nav menus. register_nav_menus(array('primary' => __('Primary Menu', 'shrake'), 'social' => __('Social Menu', 'shrake'))); // Register support for archive settings. shrake_theme()->archive_content->add_support()->set_full_text_formats(array('aside', 'audio', 'link', 'quote', 'status')); }
/** * 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 foxhound_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on Foxhound, use a find and replace * to change 'foxhound' to the name of your theme in all the template files. */ load_theme_textdomain('foxhound', 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. * 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. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support('post-thumbnails'); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => esc_html__('Primary Menu', 'foxhound'))); /* * 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')); add_post_type_support('post', 'comments'); add_post_type_support('page', 'comments'); }
function sc_3rd_party_post_type_supports() { /* support for Genesis extras */ add_post_type_support('sc_event', 'genesis-seo'); add_post_type_support('sc_event', 'genesis-layouts'); add_post_type_support('sc_event', 'genesis-simple-sidebars'); }
function dewi_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain('dewi', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page. add_theme_support('post-thumbnails'); // Declaring support for Woocommerce add_theme_support('woocommerce'); // Registering navigation menus. register_nav_menus(array('primary' => 'Primary Menu', 'footer' => 'Footer Menu')); // Cropping the images to different sizes to be used in the theme add_image_size('featured-blog-large', 750, 350, true); add_image_size('featured-blog-medium', 270, 270, true); add_image_size('featured', 642, 300, true); add_image_size('featured-blog-medium-small', 230, 230, true); // Setup the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('dewi_custom_background_args', array('default-color' => 'eaeaea'))); // Adding excerpt option box for pages as well add_post_type_support('page', 'excerpt'); }
public function add_post_type_support() { $features = array('g1-collection-element-title', 'g1-collection-element-featured-media', 'g1-collection-element-summary', 'g1-collection-element-button-1', 'g1-single-entry-settings', 'g1-single-entry-subtitle', 'g1-single-element-slider', 'g1-single-element-gmap', 'g1-single-element-breadcrumbs', 'g1-single-element-title', 'g1-single-element-media-box', 'g1-single-element-sidebar-1', 'g1-relations'); foreach ($features as $feature) { add_post_type_support($this->get_post_type(), $feature); } }
function gdlr_init_page_feature() { add_post_type_support('page', 'excerpt'); // create page categories register_taxonomy('page_category', array("page"), array('hierarchical' => true, 'label' => __('Page Categories', 'gdlr_translate'), 'singular_label' => __('Page Category', 'gdlr_translate'), 'rewrite' => array('slug' => 'page_category'))); register_taxonomy_for_object_type('page_category', 'page'); }
/** * __construct */ public function __construct() { global $content_width; if (!isset($content_width)) { $content_width = 1140; } load_theme_textdomain('habakiri', get_template_directory() . '/languages'); add_editor_style(array('./editor-style.min.css')); add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails'); add_theme_support('title-tag'); add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption')); $custom_background_defaults = array(); add_theme_support('custom-background', apply_filters('habakiri_custom_background_defaults', $custom_background_defaults)); $custom_header_defaults = array('width' => 1366, 'height' => 768, 'flex-height' => false, 'flex-width' => false, 'uploads' => true, 'random-default' => true, 'header-text' => false); add_theme_support('custom-header', apply_filters('habakiri_custom_header_defaults', $custom_header_defaults)); add_post_type_support('page', 'excerpt'); $this->customizer(); $this->register_nav_menus(); add_action('widgets_init', array($this, 'register_sidebar')); add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts')); add_action('wp_footer', array($this, 'wp_footer')); add_filter('query_vars', array($this, 'query_vars')); add_filter('tiny_mce_before_init', array($this, 'tiny_mce_before_init')); add_filter('body_class', array($this, 'body_class')); add_filter('post_class', array($this, 'post_class')); add_filter('walker_nav_menu_start_el', array($this, 'walker_nav_menu_start_el'), 10, 4); add_filter('excerpt_length', array($this, 'excerpt_length'), 9); add_filter('excerpt_mblength', array($this, 'excerpt_length'), 9); add_filter('comment_form_default_fields', array($this, 'comment_form_default_fields')); add_filter('comment_form_field_comment', array($this, 'comment_form_field_comment')); add_filter('comment_form_submit_field', array($this, 'comment_form_submit_field')); add_filter('get_calendar', array($this, 'get_calendar')); }
function radiate_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on radiate, use a find and replace * to change 'radiate' to the name of your theme in all the template files */ load_theme_textdomain('radiate', 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 on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails * Post thumbail is used for pages that are shown in the featured section of Front page. */ add_theme_support('post-thumbnails'); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'radiate'))); // 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('radiate_custom_background_args', array('default-color' => 'EAEAEA', 'default-image' => ''))); // Adding excerpt option box for pages as well add_post_type_support('page', 'excerpt'); }
function accelerate_setup() { /** * Set the content width based on the theme's design and stylesheet. */ global $content_width; if (!isset($content_width)) { $content_width = 720; } /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain('accelerate', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page. add_theme_support('post-thumbnails'); // Supporting title tag via add_theme_support (since WordPress 4.1) add_theme_support('title-tag'); // Registering navigation menus. register_nav_menus(array('primary' => __('Primary/Main Menu', 'accelerate'), 'footer' => __('Footer Menu', 'accelerate'))); // Cropping the images to different sizes to be used in the theme add_image_size('featured-blog-large', 720, 300, true); add_image_size('featured-blog-small', 230, 230, true); add_image_size('featured-service', 600, 330, true); add_image_size('featured-recent-work', 365, 365, true); // Setup the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('accelerate_custom_background_args', array('default-color' => 'eaeaea'))); // Enable support for Post Formats. add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'chat', 'audio', 'status')); // Adding excerpt option box for pages as well add_post_type_support('page', 'excerpt'); }
/** * 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 govintranet_setup() in a child theme, add your own govintranet_setup to your child theme's * functions.php file. * * @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 add_editor_style() To style the visual editor. * @uses load_theme_textdomain() For translation/localization support. * @uses add_custom_image_header() To add support for a custom header. * @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 Ten 1.0 */ function govintranet_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses post thumbnails add_theme_support('post-thumbnails'); // add post format support add_theme_support('post-formats', array('status', 'link', 'gallery', 'image', 'video', 'audio')); add_post_type_support('news', 'post-formats'); add_post_type_support('task', 'post-formats'); // This remove this the issue of not being able to preview changes post types which support post-formats function post_format_parameter($url) { $url = remove_query_arg('post_format', $url); return $url; } add_filter('preview_post_link', 'post_format_parameter'); // Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); // Make theme available for translation // Translations can be filed in the /languages/ directory load_theme_textdomain('govintranet'); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Navigation', 'govintranet'), 'secondary' => __('Secondary Navigation', 'govintranet'))); // theme options functions: require_once get_stylesheet_directory() . '/theme-options.php'; add_theme_support('custom-background'); add_theme_support('custom-header'); }
public function init() { // set translations load_plugin_textdomain('widgetkit', false, plugin_basename($this["path"]->path('widgetkit:languages'))); // get upload directory $upload = wp_upload_dir(); // set paths $this['path']->register($this->path, 'site'); $this['path']->register($this['path']->path('widgetkit:widgets'), 'widgets'); $this['path']->register($this['path']->path('widgetkit:cache'), 'cache'); $this['path']->register($upload['basedir'], 'media'); // load widgets foreach ($this['path']->dirs('widgets:') as $name) { if ($file = $this['path']->path("widgets:{$name}/{$name}.php")) { require_once $file; } } add_action('wp_ajax_nopriv_widgetkit_render', array($this, 'ajaxRender')); add_action('wp_ajax_widgetkit_render', array($this, 'ajaxRender')); // is admin or site if (is_admin()) { add_post_type_support('WIDGETKIT', 'editor'); // add widgets event $this['event']->bind('task:editor', array($this, '_editor')); // trigger event $this['event']->trigger('admin'); // add actions add_action('admin_init', array($this, '_adminInit')); add_action('admin_head', array($this, '_adminHead')); add_action('admin_menu', array($this, '_adminMenu')); add_action('wp_ajax_widgetkit', array($this, '_adminView')); // add notices if ($this->active) { add_action('admin_notices', array($this, '_adminNotices')); //fix correct invalidly nested XHTML automatically option add_filter('pre_option_use_balanceTags', create_function('', 'return 0;')); } // add editor filters add_filter('tiny_mce_before_init', array($this, '_tinymce')); add_filter('teeny_mce_before_init', array($this, '_tinymce')); } else { // add jquery add_action('wp_loaded', create_function('', "wp_enqueue_script('jquery');")); // add stylesheets/javascripts $this['asset']->addString('js', 'window["WIDGETKIT_URL"]="' . $this['path']->url("widgetkit:") . '";'); $this['asset']->addString('js', 'function wk_ajax_render_url(widgetid){ return "' . site_url('wp-admin') . '/admin-ajax.php?action=widgetkit_render&id="+widgetid}'); $this['asset']->addFile('css', 'widgetkit:css/widgetkit.css'); $this['asset']->addFile('js', 'widgetkit:js/jquery.plugins.js'); if ($this->options->get('direction') == 'rtl') { $this['asset']->addFile('css', 'widgetkit:css/rtl.css'); } // trigger event $this['event']->trigger('site'); // add actions/shortcodes/filters add_action('wp_head', array($this, '_siteHead')); add_shortcode('widgetkit', array($this, '_shortcode')); add_filter('widget_text', 'do_shortcode'); $this['event']->bind('widgetoutput', create_function('&$content', '$content=do_shortcode($content);')); } }
/** * This function is for adding extra support for features not default to the core post types. * Excerpts are added to the 'page' post type. Comments and trackbacks are added for the * 'attachment' post type. Technically, these are already used for attachments in core, but * they're not registered. * * @since 0.8.0 * @access private * @return void */ function hybrid_add_post_type_support() { /* Add support for excerpts to the 'page' post type. */ add_post_type_support('page', array('excerpt')); /* Add support for trackbacks to the 'attachment' post type. */ add_post_type_support('attachment', array('trackbacks')); }
/** * 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', 'speaker')); // add post-formats to post_type 'my_custom_post_type' add_post_type_support('speakers', 'post-formats'); // 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 }