Пример #1
1
function Destro_setup()
{
    // This theme uses wp_nav_menu() in one location.
    register_nav_menus(array('mainmenu' => __('Main Navigation', 'Destro')));
    // This theme uses post thumbnails
    add_theme_support('post-thumbnails');
    add_image_size('Destrothumb', 450, 300, true);
    // Add default posts and comments RSS feed links to head
    add_theme_support('automatic-feed-links');
    // Add translation support
    load_theme_textdomain('Destro', get_template_directory() . '/languages');
    // Delete default WordPress gallery css
    add_filter('use_default_gallery_style', '__return_false');
    // Add Custom background feature
    if (of_get_option('skin_style')) {
        $custombgargsskin = of_get_option('skin_style');
    } else {
        $custombgargsskin = 'destro';
    }
    if (get_stylesheet_directory() == get_template_directory()) {
        $custombgargs = array('default-color' => '292929', 'default-image' => get_template_directory_uri() . '/images/' . $custombgargsskin . '/page_bg.png');
    } else {
        $custombgargs = array('default-image' => get_stylesheet_directory_uri() . '/images/page_bg.png');
    }
    add_theme_support('custom-background', $custombgargs);
}
Пример #2
0
 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'));
 }
Пример #3
0
 /**
  * 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 activello_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      */
     load_theme_textdomain('activello', 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
      */
     add_theme_support('post-thumbnails');
     add_image_size('activello-featured', 1170, 550, true);
     add_image_size('activello-slider', 1920, 550, true);
     add_image_size('activello-thumbnail', 330, 220, true);
     add_image_size('activello-medium', 640, 480, true);
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => esc_html__('Primary Menu', 'activello')));
     // Enable support for Post Formats.
     add_theme_support('post-formats', array('video', 'audio'));
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('activello_custom_background_args', array('default-color' => 'FFFFFF', 'default-image' => '')));
     // Enable support for HTML5 markup.
     add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery', 'caption'));
     /*
      * 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');
 }
Пример #4
0
 /**
  * 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'))));
 }
Пример #5
0
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;
    }
}
Пример #6
0
 /**
  * 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');
 }
Пример #7
0
function wp_grade_start()
{
    //load the translations
    load_theme_textdomain(wpGrade_txtd, get_template_directory() . '/library/languages');
    // clean the head
    add_action('init', 'wpgrade_head_cleanup');
    // no Wordpress version in the RSS feed
    add_filter('the_generator', 'wpgrade_rss_version');
    // remove inline css for the recent comments widget
    add_filter('wp_head', 'wpgrade_remove_recent_comments_widget_style', 1);
    // clean up comment styles in the head
    add_action('wp_head', 'wpgrade_remove_recent_comments_style', 1);
    // clean up gallery output - remove the inline css
    add_filter('gallery_style', 'wpgrade_gallery_style');
    // enqueue base scripts and styles
    add_action('wp_enqueue_scripts', 'wpgrade_scripts_and_styles', 1);
    // custom javascript
    add_action('wp_head', 'wpgrade_load_custom_js');
    // Register theme Features
    add_action('after_setup_theme', 'custom_theme_features');
    // cleaning up <p>s around images
    add_filter('the_content', 'wpgrade_filter_ptags_on_images');
    // cleaning up excerpt - replace [..] with a Read more link
    add_filter('excerpt_more', 'wpgrade_excerpt_more');
    // Add theme support for Post Formats
    $formats = array('quote', 'video', 'audio');
    add_theme_support('post-formats', $formats);
}
Пример #8
0
 /**
  * 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');
 }
Пример #9
0
 /**
  * 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 cartel_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 'cartel' to the name of your theme in all the template files
      */
     load_theme_textdomain('cartel', 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
      */
     add_theme_support('post-thumbnails');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Menu', 'cartel')));
     // 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( 'cartel_custom_background_args', array(
     		'default-color' => 'ffffff',
     		'default-image' => '',
     	) ) );
     */
     // Enable support for HTML5 markup.
     add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery', 'caption'));
 }
Пример #10
0
 /**
  * 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 toolbox_setup() in a child theme, add your own toolbox_setup to your child theme's
  * functions.php file.
  */
 function toolbox_setup()
 {
     /**
      * Make theme available for translation
      * Translations can be filed in the /languages/ directory
      * If you're building a theme based on toolbox, use a find and replace
      * to change 'toolbox' to the name of your theme in all the template files
      */
     load_theme_textdomain('toolbox', get_template_directory() . '/languages');
     $locale = get_locale();
     $locale_file = get_template_directory() . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     /**
      * 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_menus(array('primary' => __('Primary Menu', 'toolbox')));
     /**
      * Add support for the Aside and Gallery Post Formats
      */
     add_theme_support('post-formats', array('aside', 'image', 'gallery'));
 }
Пример #11
0
 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');
 }
Пример #12
0
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');
}
Пример #13
0
 function avenue_setup()
 {
     if (!isset($content_width)) {
         global $content_width;
         $content_width = 1060;
     }
     define('SC_BYBLOS_VERSION', '2.0');
     load_theme_textdomain('avenue', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     add_theme_support('post-thumbnails');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     register_nav_menus(array('primary' => __('Primary Menu', 'avenue')));
     // 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('avenue_custom_background_args', array('default-color' => 'ffffff', 'default-image' => '')));
     // Enable support for HTML5 markup.
     add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery', 'caption'));
     add_filter('widget_text', 'do_shortcode');
 }
Пример #14
0
/**
 * 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
}
Пример #15
0
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;
    }
}
Пример #16
0
/**
 * 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'));
}
Пример #17
0
function reciprocal_essential_functions()
{
    // for dynamic title
    add_theme_support('title-tag');
    // for customize Header Image
    $els_header_img = array('default-image' => get_template_directory_uri() . '/images/custom-header-bg.jpg');
    add_theme_support('custom-header', $els_header_img);
    //---------------------------
    // for customize background color
    add_theme_support('custom-background');
    //---------------------------
    // for add featured image
    add_theme_support('post-thumbnails');
    //---------------------------
    // theme textdomain
    load_theme_textdomain('reciprocal', get_template_directory_uri() . '/languages');
    //---------------------------
    // for menu register--------
    if (function_exists('register_nav_menus')) {
        register_nav_menus(array('prodhanmenu' => __('Main Menu', 'reciprocal'), 'nichermenu' => __('Footer Menu', 'reciprocal')));
    }
    //---------------------------
    function short_description($limit)
    {
        $content = explode(' ', get_the_content());
        $less_content = array_slice($content, 0, $limit);
        echo implode(' ', $less_content);
    }
}
Пример #18
0
 function az_theme_setup()
 {
     global $options_alice;
     // Load Translation Domain
     load_theme_textdomain(AZ_THEME_NAME, get_template_directory() . '/languages');
     // Register Menus
     register_nav_menus(array('primary_menu' => __('Primary Menu', AZ_THEME_NAME)));
     // Add RSS Feed links to HTML
     add_theme_support('automatic-feed-links');
     // Add Support for Post Formats
     // add_theme_support('post-formats', array('quote','video','audio', 'image', 'gallery','link'));
     // Enable excerpts for pages
     add_post_type_support('page', 'excerpt');
     // Configure Thumbnails
     add_theme_support('post-thumbnails');
     // WP 4.1 title tag
     add_theme_support('title-tag');
     // Social meta
     if (!empty($options_alice['global_menu_share_button']) && $options_alice['global_menu_share_button'] == 'enable') {
         add_filter('wp_head', 'az_social_meta', 2);
     }
     // Remove Emoji's
     remove_action('wp_head', 'print_emoji_detection_script', 7);
     remove_action('wp_print_styles', 'print_emoji_styles');
 }
Пример #19
0
 /**
  * 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 reddle_setup() in a child theme, add your own reddle_setup to your child theme's
  * functions.php file.
  */
 function reddle_setup()
 {
     /**
      * Make theme available for translation
      * Translations can be filed in the /languages/ directory
      * If you're building a theme based on Reddle, use a find and replace
      * to change 'reddle' to the name of your theme in all the template files
      */
     load_theme_textdomain('reddle', get_template_directory() . '/languages');
     /**
      * 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_menus(array('primary' => __('Primary Menu', 'reddle')));
     /**
      * Add support for the Aside and Gallery Post Formats
      */
     add_theme_support('post-formats', array('aside', 'image'));
     /**
      * Add in support for post thumbnails
      */
     add_theme_support('post-thumbnails');
     /**
      * Add support for custom backgrounds
      */
     add_theme_support('custom-background');
 }
Пример #20
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  */
 function minileven_setup()
 {
     global $wp_version;
     /**
      * Custom template tags for this theme.
      */
     require get_template_directory() . '/inc/template-tags.php';
     /**
      * Custom functions that act independently of the theme templates
      */
     require get_template_directory() . '/inc/tweaks.php';
     /* Make Minileven available for translation.
      * Translations can be added to the /languages/ directory.
      * If you're building a theme based on Minileven, use a find and replace
      * to change 'minileven' to the name of your theme in all the template files.
      */
     load_theme_textdomain('minileven', TEMPLATEPATH . '/languages');
     // 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', 'jetpack'));
     // Add support for a variety of post formats
     add_theme_support('post-formats', array('gallery'));
     // Add support for custom backgrounds
     if (version_compare($wp_version, '3.4', '>=')) {
         add_theme_support('custom-background');
     } else {
         add_custom_background();
     }
     // Add support for post thumbnails
     add_theme_support('post-thumbnails');
 }
Пример #21
0
/**
 * 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'));
}
Пример #22
0
function et_setup_theme()
{
    global $themename, $shortname, $et_store_options_in_one_row, $default_colorscheme;
    $themename = 'Divi';
    $shortname = 'divi';
    $et_store_options_in_one_row = true;
    $default_colorscheme = "Default";
    $template_directory = get_template_directory();
    require_once $template_directory . '/epanel/custom_functions.php';
    require_once $template_directory . '/includes/functions/comments.php';
    require_once $template_directory . '/includes/functions/sidebars.php';
    load_theme_textdomain('Divi', $template_directory . '/lang');
    require_once $template_directory . '/epanel/core_functions.php';
    require_once $template_directory . '/epanel/post_thumbnails_divi.php';
    include $template_directory . '/includes/widgets.php';
    register_nav_menus(array('primary-menu' => __('Primary Menu', 'Divi'), 'secondary-menu' => __('Secondary Menu', 'Divi'), 'footer-menu' => __('Footer Menu', 'Divi')));
    // don't display the empty title bar if the widget title is not set
    remove_filter('widget_title', 'et_widget_force_title');
    add_action('wp_enqueue_scripts', 'et_add_responsive_shortcodes_css', 11);
    add_theme_support('post-formats', array('video', 'audio', 'quote', 'gallery', 'link'));
    add_theme_support('woocommerce');
    remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
    remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    add_action('woocommerce_before_main_content', 'et_divi_output_content_wrapper', 10);
    remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
    add_action('woocommerce_after_main_content', 'et_divi_output_content_wrapper_end', 10);
    //remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
    // deactivate page templates and custom import functions
    remove_action('init', 'et_activate_features');
}
Пример #23
0
function bones_ahoy()
{
    // let's get language support going, if you need it
    load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation');
    // launching operation cleanup
    add_action('init', 'bones_head_cleanup');
    // A better title
    add_filter('wp_title', 'rw_title', 10, 3);
    // remove WP version from RSS
    add_filter('the_generator', 'bones_rss_version');
    // remove pesky injected css for recent comments widget
    add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1);
    // clean up comment styles in the head
    add_action('wp_head', 'bones_remove_recent_comments_style', 1);
    // clean up gallery output in wp
    add_filter('gallery_style', 'bones_gallery_style');
    // enqueue base scripts and styles
    add_action('wp_enqueue_scripts', 'bones_scripts_and_styles', 999);
    // ie conditional wrapper
    // launching this stuff after theme setup
    bones_theme_support();
    // adding sidebars to Wordpress (these are created in functions.php)
    add_action('widgets_init', 'bones_register_sidebars');
    // 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');
}
Пример #24
0
 static function setup()
 {
     load_theme_textdomain('basics', get_template_directory() . '/lang');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     register_nav_menus(array('primary_navigation' => __('Primary Navigation', 'basics'), 'utility_navigation' => __('Utility Navigation', 'basics')));
 }
Пример #25
0
 /**
  * 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));
 }
 /**
  * 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 _act_setup()
 {
     load_theme_textdomain('_s', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     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', '_act'), 'hero' => esc_html__('Hero', '_act')));
     /*
      * 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 https://developer.wordpress.org/themes/functionality/post-formats/
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
     // Set up the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('_act_custom_background_args', array('default-color' => 'ffffff', 'default-image' => '')));
     add_image_size('feature500', 500, 500, true);
 }
Пример #27
0
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");
    }
}
Пример #28
0
 /**
  * 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')));
 }
Пример #29
0
function gsalborz_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('gsalborz', get_template_directory() . '/languages');
    // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY
    require_once 'library/custom-post-type.php';
    // launching operation cleanup
    add_action('init', 'gsalborz_head_cleanup');
    // A better title
    add_filter('wp_title', 'rw_title', 10, 3);
    // remove WP version from RSS
    add_filter('the_generator', 'gsalborz_rss_version');
    // remove pesky injected css for recent comments widget
    add_filter('wp_head', 'gsalborz_remove_wp_widget_recent_comments_style', 1);
    // clean up comment styles in the head
    add_action('wp_head', 'gsalborz_remove_recent_comments_style', 1);
    // clean up gallery output in wp
    add_filter('gallery_style', 'gsalborz_gallery_style');
    // enqueue base scripts and styles
    add_action('wp_enqueue_scripts', 'gsalborz_scripts_and_styles', 999);
    // ie conditional wrapper
    // launching this stuff after theme setup
    gsalborz_theme_support();
    // adding sidebars to Wordpress (these are created in functions.php)
    add_action('widgets_init', 'gsalborz_register_sidebars');
    // cleaning up random code around images
    add_filter('the_content', 'gsalborz_filter_ptags_on_images');
    // cleaning up excerpt
    add_filter('excerpt_more', 'gsalborz_excerpt_more');
}
Пример #30
0
/**
 * 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
}