コード例 #1
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * @since 1.0.0
  */
 function presscore_setup()
 {
     /* Load theme text domain */
     load_theme_textdomain(LANGUAGE_ZONE, get_template_directory() . '/languages');
     if (is_child_theme()) {
         load_child_theme_textdomain(CHILD_LANGUAGE_ZONE, get_stylesheet_directory() . '/languages');
     }
     /**
      * Editor 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
      */
     add_theme_support('post-thumbnails');
     /**
      * This theme uses wp_nav_menu() in one location.
      */
     register_nav_menus(array('primary' => __('Primary Menu', LANGUAGE_ZONE), 'top' => __('Top Menu', LANGUAGE_ZONE), 'bottom' => __('Bottom Menu', LANGUAGE_ZONE)));
     /**
      * Enable support for Post Formats
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'status'));
     /**
      * Allow shortcodes in widgets.
      *
      */
     add_filter('widget_text', 'do_shortcode');
     // create upload dir
     wp_upload_dir();
 }
コード例 #2
0
/**
 * Setup function. All child themes should run their setup within this function. The idea is to add/remove 
 * filters and actions after the parent theme has been set up. This function provides you that opportunity.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function kuorinka_child_dev_theme_setup()
{
    /* Load child theme text domain. */
    load_child_theme_textdomain('kuorinka-child-dev', get_stylesheet_directory() . '/languages');
    /*
     * Add a custom background to overwrite the defaults. Remove this section if you want to use 
     * the parent theme defaults instead.
     *
     * @link http://codex.wordpress.org/Custom_Backgrounds
     */
    add_theme_support('custom-background', array('default-color' => 'f7f7f7', 'default-image' => ''));
    /*
     * Add a custom header to overwrite the defaults. Remove this section if you want to use the 
     * the parent theme defaults instead.
     *
     * @link http://codex.wordpress.org/Custom_Headers
     */
    add_theme_support('custom-header', array('default-text-color' => '2e2e2e', 'default-image' => get_stylesheet_directory_uri() . '/images/headers/child.jpg'));
    /*
     * Registers default headers for the theme. If you don't want to add custom headers, remove 
     * this section. Note: Header thumbnail sizes should be 230x78.
     *
     * @link http://codex.wordpress.org/Function_Reference/register_default_headers
     */
    register_default_headers(array('child' => array('url' => '%2$s/images/headers/child.jpg', 'thumbnail_url' => '%2$s/images/headers/child-thumbnail.jpg', 'description' => __('Test header', 'kuorinka-child-dev'))));
    /* Add child theme fonts to editor styles. */
    add_editor_style(kuorinka_child_dev_fonts_url());
}
コード例 #3
0
ファイル: functions.php プロジェクト: vegemite4me/goran-pest
/**
 * 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');
}
コード例 #4
0
/**
 * Sets up theme defaults and registers support for various WordPress features
 * of Muenchen Child Theme.
 *
 * Note that this function is hooked into the after_setup_theme hook, which runs
 * before the init hook. The init hook is too late for some features, such as indicating
 * support for post thumbnails.
 *
 * @since   05/07/2015
 * @return  void
 */
function muenchen_child_setup()
{
    /* The .min suffix for stylesheets and scripts.
     *
     * In order to provide a quick start, this child theme by default will load
     * regular CSS and javascript files (whereas its parent theme loads
     * minified versions of its stylesheets and scripts by default).
     *
     * If you want your child theme to default on minified stylesheets and scripts,
     * set the following filter:
     *
     * if( function_exists( 'muenchen_get_script_suffix' ) ) {
     *     add_filter( 'muenchen_child_starter_get_script_suffix', 'muenchen_get_script_suffix' );
     * }
     *
     * Don’t forget to actually add applicable .min files to your child theme first!
     *
     * You can then temporarily switch back to unminified versions of the same
     * files by setting the constant SCRIPT_DEBUG to TRUE in your wp-config.php:
     * define( 'SCRIPT_DEBUG', TRUE );
     */
    // Loads the child theme's translated strings
    load_child_theme_textdomain('muenchen-child-starter', get_stylesheet_directory() . '/languages');
    if (!is_admin()) {
        // child theme styles
        add_filter('muenchen_get_styles', 'muenchen_child_filter_muenchen_get_styles_add_stylesheets');
    }
}
コード例 #5
0
ファイル: functions.php プロジェクト: robwri32/garland
 function venedor_theme_setup()
 {
     if (function_exists('add_theme_support')) {
         // Default RSS feed links
         add_theme_support('automatic-feed-links');
         // Woocommerce Support
         add_theme_support('woocommerce');
         // Post Formats
         add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio', 'chat'));
         // Image Size
         add_theme_support('post-thumbnails');
         $related_post_w = isset($venedor_settings['related-post-w']) ? $venedor_settings['related-post-w'] : 400;
         $related_post_h = isset($venedor_settings['related-post-h']) ? $venedor_settings['related-post-h'] : $related_post_w * 184 / 400;
         add_image_size('post-related', $related_post_w, $related_post_h, true);
         $related_portfolio_w = isset($venedor_settings['related-portfolio-w']) ? $venedor_settings['related-portfolio-w'] : 400;
         $related_portfolio_h = isset($venedor_settings['related-portfolio-h']) ? $venedor_settings['related-portfolio-h'] : $related_portfolio_w * 320 / 400;
         add_image_size('portfolio-related', $related_portfolio_w, $related_portfolio_h, true);
         add_image_size('post-large', 1140);
         add_image_size('post-medium', 1000);
         add_image_size('post-small', 645);
         add_image_size('post-grid', 560);
         add_image_size('post-timeline', 560);
         add_image_size('portfolio-single-large', 1140);
         add_image_size('portfolio-single-medium', 750);
         add_image_size('portfolio-grid2', 560);
         add_image_size('portfolio-grid3', 400);
         add_image_size('portfolio-grid4', 400);
         add_editor_style();
     }
     // Translation
     load_theme_textdomain('venedor', TEMPLATEPATH . '/languages');
     load_child_theme_textdomain('venedor', get_stylesheet_directory() . '/languages');
 }
コード例 #6
0
ファイル: functions.php プロジェクト: aaghran/aaghran.com
/**
 * Set up Ever After specific setting.
 *
 * @since Ever After 1.0
 */
function everafter_setup()
{
    /**
     * Declare textdomain for this child theme.
     * Translations can be filed in the /languages/ directory
     */
    load_child_theme_textdomain('everafter', get_stylesheet_directory() . '/languages');
}
コード例 #7
0
function initComponents()
{
    load_child_theme_textdomain('components', get_stylesheet_directory() . '/lang');
    load_theme_textdomain('components', get_template_directory() . '/lang');
    if (function_exists('vc_map')) {
        $autoloader = new \DigitalUnited\Components\Autoloader();
        $autoloader->requireFiles();
        $autoloader->registerComponents();
    }
}
コード例 #8
0
function pda_theme_setup()
{
    load_child_theme_textdomain('hemingway', get_stylesheet_directory() . '/languages');
    // images sizes
    // add_image_size( 'cycle_destaque', 320, 250, array( 'bottom', 'left') );
    add_image_size('cycle_destaque', 600, 469, array('bottom', 'left'));
    add_image_size('index-image', 730, 410, true);
    // altera configurações da imagem padrão do header
    add_theme_support('custom-header', array('default-image' => '', 'width' => 500, 'height' => 250, 'flex-height' => true));
}
コード例 #9
0
ファイル: functions.php プロジェクト: HongLarry/wordpress
function dreamway_setup()
{
    $defaults = sgwindow_get_defaults();
    load_child_theme_textdomain('dreamway', get_stylesheet_directory() . '/languages');
    $args = array('default-image' => get_stylesheet_directory_uri() . '/img/header.jpg', 'header-text' => true, 'default-text-color' => '000', 'width' => absint(sgwindow_get_theme_mod('size_image')), 'height' => absint(sgwindow_get_theme_mod('size_image_height')), 'flex-height' => true, 'flex-width' => true);
    add_theme_support('custom-header', $args);
    remove_action('sgwindow_empty_sidebar_before_footer-home', 'sgwindow_the_footer_sidebar_widgets', 20);
    remove_action('sgwindow_empty_sidebar_top-home', 'sgwindow_the_top_sidebar_widgets', 20);
    remove_action('sgwindow_empty_column_2-portfolio-page', 'sgwindow_right_sidebar_portfolio', 20);
    remove_action('admin_menu', 'sgwindow_admin_page');
}
コード例 #10
0
/**
 * Loads the theme, child theme, and framework textdomains automatically. No need for theme authors
 * to do this. This also utilizes the `Domain Path` header from `style.css`.  It defaults to the
 * `languages` folder.  Theme authors should define this as `/lang`, `/languages` or some other
 * variation of their choosing.
 *
 * @since  3.0.0
 * @access public
 * @return void
 */
function hybrid_load_textdomains()
{
    // Load theme textdomain.
    load_theme_textdomain(hybrid_get_parent_textdomain(), HYBRID_PARENT . hybrid_get_parent_domain_path());
    // Load child theme textdomain.
    if (is_child_theme()) {
        load_child_theme_textdomain(hybrid_get_child_textdomain(), HYBRID_CHILD . hybrid_get_child_domain_path());
    }
    // Load the framework textdomain.
    hybrid_load_framework_textdomain();
}
コード例 #11
0
ファイル: functions.php プロジェクト: nikitansk/devschool
function wplms_modern_theme_setup()
{
    $locale = get_locale();
    $locale_file = get_stylesheet_directory() . "/languages/";
    $global_file = WP_LANG_DIR . "/themes/wplms_modern/";
    if (file_exists($global_file . $locale . '.mo')) {
        load_child_theme_textdomain('wplms_modern', $global_file);
    } else {
        load_child_theme_textdomain('wplms_modern', $locale_file);
    }
}
コード例 #12
0
ファイル: functions.php プロジェクト: aragonc/3clicks
/**
 * Enable translation (i18n)
 */
function g1_init_localization_before_theme()
{
    $dir = trailingslashit(get_template_directory());
    if (!load_child_theme_textdomain('g1_theme', get_stylesheet_directory() . '/languages')) {
        load_theme_textdomain('g1_theme', $dir . 'languages');
    }
    $locale = get_locale();
    $locale_file = $dir . "languages/{$locale}.php";
    if (is_readable($locale_file)) {
        require_once $locale_file;
    }
}
コード例 #13
0
 /**
  * Theme setup.
  *
  * @since 1.0.0
  */
 function presscore_setup()
 {
     /**
      * Load child theme text domain.
      */
     if (is_child_theme()) {
         load_child_theme_textdomain('the7mk2', get_stylesheet_directory() . '/languages');
     }
     /**
      * Load theme text domain.
      */
     load_theme_textdomain('the7mk2', get_template_directory() . '/languages');
     /**
      * Register custom menu.
      */
     register_nav_menus(array('primary' => _x('Primary Menu', 'backend', 'the7mk2'), 'split_left' => _x('Split Menu Left', 'backend', 'the7mk2'), 'split_right' => _x('Split Menu Right', 'backend', 'the7mk2'), 'mobile' => _x('Mobile Menu', 'backend', 'the7mk2'), 'top' => _x('Top Menu', 'backend', 'the7mk2'), 'bottom' => _x('Bottom Menu', 'backend', 'the7mk2')));
     /**
      * Load editor 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.
      */
     add_theme_support('post-thumbnails');
     /**
      * Add title tag support.
      */
     add_theme_support('title-tag');
     /**
      * Enable support for Post Formats.
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'status'));
     /**
      * Enable support for various theme modules.
      */
     presscore_enable_theme_modules();
     /**
      * Allow shortcodes in widgets.
      */
     add_filter('widget_text', 'do_shortcode');
     /**
      * Create upload dir.
      */
     wp_upload_dir();
     /**
      * Register theme template parts dir.
      */
     presscore_template_manager()->add_path('theme', 'template-parts');
 }
コード例 #14
0
ファイル: functions.php プロジェクト: farhanbashir/smith
/**
 * 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 cubic_setup()
{
    /*
     * Declare textdomain for this child theme.
     */
    load_child_theme_textdomain('cubic', 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('boardwalk-featured-image', 980, 980, true);
}
コード例 #15
0
ファイル: functions.php プロジェクト: eellak/gpchild-ellak
function ellak_theme_setup()
{
    // remove generatepress action hooks
    remove_action('generate_before_content', 'generate_featured_page_header_inside_single', 10);
    remove_action('generate_credits', 'generate_add_footer_info');
    // child theme translations in /languages
    load_child_theme_textdomain('gpchild-ellak', get_template_directory() . '/languages');
    // hide admin bar for subscribers
    $user = wp_get_current_user();
    if (in_array('subscriber', $user->roles)) {
        show_admin_bar(false);
    }
}
コード例 #16
0
ファイル: functions.php プロジェクト: booklein/wpbookle
 function porto_setup()
 {
     add_theme_support("title-tag");
     //add_theme_support( "custom-header", array() );
     //add_theme_support( 'custom-background', array() );
     add_editor_style(array('style.css', 'style_rtl.css'));
     if (defined('WOOCOMMERCE_VERSION')) {
         if (version_compare(WOOCOMMERCE_VERSION, "2.1") >= 0) {
             add_filter('woocommerce_enqueue_styles', '__return_empty_array');
         } else {
             define('WOOCOMMERCE_USE_CSS', false);
         }
     }
     // translation
     load_theme_textdomain('porto', porto_dir . '/languages');
     load_child_theme_textdomain('porto', get_stylesheet_directory() . '/languages');
     /**
      * Porto theme options
      */
     require_once porto_admin . '/theme_options.php';
     global $porto_settings;
     // default rss feed links
     add_theme_support('automatic-feed-links');
     // add support for post thumbnails
     add_theme_support('post-thumbnails');
     // add image sizes
     add_image_size('blog-large', 1140, 445, true);
     add_image_size('blog-medium', 463, 348, true);
     add_image_size('related-post', isset($porto_settings['post-related-image-size']) && (int) $porto_settings['post-related-image-size']['width'] ? (int) $porto_settings['post-related-image-size']['width'] : 450, isset($porto_settings['post-related-image-size']) && (int) $porto_settings['post-related-image-size']['height'] ? (int) $porto_settings['post-related-image-size']['height'] : 231, true);
     add_image_size('portfolio-large', 560, 560, true);
     add_image_size('portfolio-medium', 367, 367, true);
     add_image_size('related-portfolio', 450, 450, true);
     add_image_size('member', 367, 367, true);
     add_image_size('widget-thumb-medium', 85, 85, true);
     add_image_size('widget-thumb', 50, 50, true);
     // woocommerce support
     add_theme_support('woocommerce');
     // allow shortcodes in widget text
     add_filter('widget_text', 'do_shortcode');
     // register menus
     register_nav_menus(array('main_menu' => __('Main Menu', 'porto'), 'sidebar_menu' => __('Sidebar Menu', 'porto'), 'top_nav' => __('Top Navigation', 'porto'), 'view_switcher' => __('View Switcher', 'porto'), 'currency_switcher' => __('Currency Switcher', 'porto')));
     // add post formats
     add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio', 'chat'));
     // disable master slider woocommerce product slider
     $options = get_option('msp_woocommerce');
     if (isset($options) && isset($options['enable_single_product_slider']) && $options['enable_single_product_slider'] == 'on') {
         $options['enable_single_product_slider'] = '';
         update_option('msp_woocommerce', $options);
     }
 }
コード例 #17
0
ファイル: functions.php プロジェクト: hscale/webento
function child_theme_setup()
{
    // ** Backend **
    // Translations
    load_child_theme_textdomain('social-coup', get_stylesheet_directory() . '/lib/languages');
    // Image Sizes
    add_image_size('sc_thumbnail', 405, 375, true);
    // Sidebars
    unregister_sidebar('sidebar-alt');
    unregister_sidebar('header-right');
    add_theme_support('genesis-footer-widgets', 3);
    genesis_register_sidebar(array('name' => __('Home Left', 'social-coup'), 'id' => 'home-left'));
    genesis_register_sidebar(array('name' => __('Home Middle', 'social-coup'), 'id' => 'home-middle'));
    genesis_register_sidebar(array('name' => __('Home Right', 'social-coup'), 'id' => 'home-right'));
    // Remove Unused Page Layouts
    genesis_unregister_layout('content-sidebar-sidebar');
    genesis_unregister_layout('sidebar-sidebar-content');
    genesis_unregister_layout('sidebar-content-sidebar');
    // Setup Theme Settings
    include_once CHILD_DIR . '/lib/admin/child-theme-settings.php';
    // Editor Stylesheet
    add_editor_style('editor-style.css');
    // Hide Editor on Specific Template Pages
    add_action('admin_init', 'sc_hide_editor');
    // Activate Required Plugins
    require_once CHILD_DIR . '/lib/classes/class-tgm-plugin-activation.php';
    add_action('tgmpa_register', 'cs_register_required_plugins');
    // Add support for custom header
    add_theme_support('genesis-custom-header', array('width' => 545, 'height' => 184, 'textcolor' => '333', 'admin_header_callback' => 'sc_admin_style', 'header_callback' => 'sc_custom_header_style'));
    // ** Frontend **
    // Remove Edit Link
    add_filter('edit_post_link', '__return_false');
    // Viewport Meta Tag for Mobile Browsers
    add_action('genesis_meta', 'cs_viewport_meta_tag');
    // Structural Wraps
    add_theme_support('genesis-structural-wraps', array('header', 'nav', 'subnav', 'event-information', 'footer-widgets', 'footer'));
    // Remove text from search
    add_filter('genesis_search_text', '__return_false');
    add_filter('genesis_search_button_text', '__return_false');
    // Move navigation above header
    remove_action('genesis_after_header', 'genesis_do_nav');
    add_action('genesis_before_header', 'genesis_do_nav');
    // Remove site tagline from header
    add_filter('genesis_seo_description', '__return_false');
    // Event Information
    add_action('genesis_after_header', 'cs_event_description');
    // Footer Text
    add_filter('genesis_footer_backtotop_text', 'cs_footer_left');
    add_filter('genesis_footer_creds_text', 'cs_footer_right');
}
コード例 #18
0
 static function support()
 {
     global $content_width;
     if (!isset($content_width)) {
         $content_width = 1140;
     }
     add_theme_support('content-width', 1140);
     add_theme_support('automatic-feed-links');
     add_theme_support('post-thumbnails');
     add_theme_support('custom-background', array('default-color' => 'ffffff', 'default-image' => ''));
     add_image_size('mythemes-classic', 1140, 515, true);
     load_theme_textdomain('treeson');
     load_theme_textdomain('treeson', get_template_directory() . '/media/ln');
     load_child_theme_textdomain('treeson');
 }
コード例 #19
0
ファイル: INIT.php プロジェクト: shimion/stlucks
 protected function init_framework()
 {
     load_theme_textdomain('tfuse');
     load_theme_textdomain('tfuse', TFUSE_THEME_DIR . '/languages');
     if (function_exists('load_child_theme_textdomain')) {
         load_child_theme_textdomain('tfuse');
     }
     add_action('init', 'tfuse_register_gallery_group_post_type');
     add_action('init', 'tfuse_register_download_group_post_type');
     add_action('wp_ajax_tfuse_get_suggest', 'tfuse_get_suggest');
     add_action('wp_ajax_autosave_post_options', array(&$this->fwoptions, 'autosave_post_options'));
     add_filter('themefuse_shortcodes', 'do_shortcode');
     add_filter('widget_text', 'do_shortcode');
     # This sets the HTML Editor as default #
     add_filter('wp_default_editor', create_function('', 'return "html";'));
 }
コード例 #20
0
function criticalink_setup()
{
    // remove Make pro upgrade notices
    remove_action('edit_form_after_title', 'ttfmake_plus_quick_start');
    remove_action('add_meta_boxes', 'ttfmake_add_plus_metabox');
    // remove Make edit scripts
    remove_action('admin_enqueue_scripts', 'ttfmake_edit_page_script');
    add_filter('make_show_footer_credit', '__return_false');
    // load childtheme text domain
    load_child_theme_textdomain('criticalink', get_stylesheet_directory() . '/languages');
    // add post-formats
    add_theme_support('post-formats', array('link', 'video', 'photo'));
    // support common tinymce styles
    add_theme_support('common-tinymce-styles');
    // add custom image
    add_image_size('banner', 1080, 9999);
}
コード例 #21
0
ファイル: functions.php プロジェクト: gizburdt/scaffolder
 /**
  * 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 scaffolder_setup()
 {
     // Textdomain
     load_theme_textdomain('scaffolder', get_template_directory() . '/languages');
     load_child_theme_textdomain('scaffolder', get_stylesheet_directory() . '/languages');
     // Theme support
     add_theme_support('menus');
     add_theme_support('post-thumbnails');
     add_theme_support('automatic-feed-links');
     add_theme_support('post-formats', array());
     add_theme_support('title-tag');
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list'));
     // Editor
     add_editor_style('assets/css/editor-style.css');
     // Menus
     register_nav_menus(array('primary-menu' => __('Primary menu', 'scaffolder'), 'secondary-menu' => __('Secondary menu', 'scaffolder'), 'footer-menu' => __('Footer menu', 'scaffolder')));
 }
コード例 #22
0
ファイル: functions.php プロジェクト: davnopora/first
/**
 * 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 composer_theme_setup()
{
    remove_theme_support('theme-layouts');
    /* Load the primary menu. */
    remove_action('omega_before_header', 'omega_get_primary_menu');
    add_action('omega_header', 'omega_get_primary_menu');
    add_filter('omega_site_description', 'composer_site_description');
    add_action('omega_after_header', 'composer_banner');
    add_theme_support('omega-footer-widgets', 3);
    remove_action('omega_after_main', 'omega_primary_sidebar');
    /* Add support for a custom header image. */
    add_theme_support('custom-header', array('header-text' => false, 'flex-width' => true, 'width' => 1024, 'flex-height' => true, 'height' => 600, 'uploads' => true, 'default-image' => get_stylesheet_directory_uri() . '/images/header.jpg'));
    add_action('wp_enqueue_scripts', 'composer_scripts_styles');
    remove_action('omega_before_entry', 'omega_entry_header');
    add_action('omega_before_entry', 'composer_entry_header');
    remove_action('omega_before_loop', 'omega_archive_title');
    load_child_theme_textdomain('composer', get_stylesheet_directory() . '/languages');
}
コード例 #23
0
ファイル: functions.php プロジェクト: Rameshbhushal/newsroom
function newsroom_setup()
{
    add_image_size('highlight-carousel', 672, 380, true);
    add_image_size('kicker', 1020, 800);
    add_image_size('small-thumb', 87, 87, true);
    add_image_size('list-thumb', 237, 112, true);
    add_theme_support('automatic-feed-links');
    add_theme_support('post-thumbnails');
    // text domain
    load_child_theme_textdomain('newsroom', get_stylesheet_directory() . '/languages');
    // nav
    register_nav_menus(array('header_menu' => __('Header menu', 'newsroom'), 'footer_menu' => __('Footer menu', 'newsroom')));
    unregister_sidebar('front_page');
    //sidebars
    register_sidebar(array('name' => __('Post sidebar', 'newsroom'), 'id' => 'post', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('General sidebar', 'newsroom'), 'id' => 'general', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Archive sidebar', 'newsroom'), 'id' => 'archive', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => __('Search results sidebar', 'newsroom'), 'id' => 'search', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
}
コード例 #24
0
ファイル: functions.php プロジェクト: sedici/wpmu-istec
 private function _load_textdomain()
 {
     $path = untrailingslashit(self::get_root_dir()) . '/languages';
     load_theme_textdomain('upfront', $path);
     // Now let's try the child theme...
     $current = wp_get_theme();
     $parent = $current->parent();
     if (empty($parent)) {
         return false;
     }
     // Current theme is not a child theme, carry on...
     if ('upfront' !== $parent->get_template()) {
         return false;
     }
     // Not an Upfront child, carry on...
     $child_domain = $current->get('TextDomain');
     if (!empty($child_domain) && 'upfront' !== $child_domain) {
         load_child_theme_textdomain($child_domain, get_stylesheet_directory() . '/languages');
     }
 }
コード例 #25
0
ファイル: functions.php プロジェクト: jpbender/wp_virtual
/**
 * Setup function. All child themes should run their setup within this function. The idea is to add/remove 
 * filters and actions after the parent theme has been set up. This function provides you that opportunity.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function eemeli_theme_setup()
{
    /* Load child theme text domain. */
    load_child_theme_textdomain('eemeli', get_stylesheet_directory() . '/languages');
    /*
     * Add a custom background to overwrite the defaults.
     *
     * @link http://codex.wordpress.org/Custom_Backgrounds
     */
    add_theme_support('custom-background', array('default-color' => 'eef2f5', 'default-image' => ''));
    /*
     * Add a custom header to overwrite the defaults.
     *
     * @link http://codex.wordpress.org/Custom_Headers
     */
    add_theme_support('custom-header', array('default-image' => get_stylesheet_directory_uri() . '/images/header-image.jpg', 'default-text-color' => 'f2f2f2', 'height' => 550));
    /* Registers default headers for the theme. We need this so that we can set default image back. */
    register_default_headers(array('eemeli-header' => array('url' => '%2$s/images/header-image.jpg', 'thumbnail_url' => '%2$s/images/header-image.jpg', 'description' => __('Default Header Image', 'eemeli'))));
    /* Add child theme fonts to editor styles. */
    add_editor_style(eemeli_fonts_url());
}
コード例 #26
0
 function porto_setup()
 {
     add_theme_support("title-tag");
     //add_theme_support( "custom-header", array() );
     //add_theme_support( 'custom-background', array() );
     add_editor_style(array('style.css', 'style_rtl.css'));
     if (defined('WOOCOMMERCE_VERSION')) {
         if (version_compare(WOOCOMMERCE_VERSION, "2.1") >= 0) {
             add_filter('woocommerce_enqueue_styles', '__return_false');
         } else {
             define('WOOCOMMERCE_USE_CSS', false);
         }
     }
     // translation
     load_theme_textdomain('porto', porto_dir . '/languages');
     load_child_theme_textdomain('porto', get_stylesheet_directory() . '/languages');
     // default rss feed links
     add_theme_support('automatic-feed-links');
     // add support for post thumbnails
     add_theme_support('post-thumbnails');
     // add image sizes
     add_image_size('blog-large', 1140, 445, true);
     add_image_size('blog-medium', 463, 348, true);
     add_image_size('related-post', 450, 231, true);
     add_image_size('portfolio-large', 560, 560, true);
     add_image_size('portfolio-medium', 367, 367, true);
     add_image_size('related-portfolio', 450, 450, true);
     add_image_size('member', 367, 367, true);
     add_image_size('widget-thumb-medium', 85, 85, true);
     add_image_size('widget-thumb', 50, 50, true);
     // woocommerce support
     add_theme_support('woocommerce');
     // allow shortcodes in widget text
     add_filter('widget_text', 'do_shortcode');
     // register menus
     register_nav_menus(array('main_menu' => 'Main Menu', 'top_nav' => 'Top Navigation', 'view_switcher' => 'View Switcher', 'currency_switcher' => 'Currency Switcher'));
     // add post formats
     add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio', 'chat'));
 }
コード例 #27
0
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Declare textdomain for this child theme.
* Translations can be filed in the /languages/ directory.
*/
function simpleportal_setup()
{
    load_child_theme_textdomain('simpleportal', get_stylesheet_directory() . '/languages');
    // custom header
    $args = array('flex-width' => true, 'width' => 1170, 'flex-height' => true);
    add_theme_support('custom-header', $args);
    // add featured image sizes
    if (function_exists('add_theme_support')) {
        add_theme_support('post-thumbnails');
        set_post_thumbnail_size(150, 150);
        // default Post Thumbnail dimensions
    }
    if (function_exists('add_image_size')) {
        add_image_size('4-column-gallery-thumb', 240, 108, true);
        //(cropped)
    }
    // Custom background image
    add_theme_support('custom-background');
    // Register Custom Navigation Walker
    require_once 'wp_bootstrap_navwalker.php';
    // This theme uses wp_nav_menu() in 7 locations.
    register_nav_menus(array('top-right' => __('Top Right Navigation', 'simpleportal'), 'primary' => __('Primary Navigation', 'simpleportal'), 'admin' => __('Admin Navigation', 'simpleportal'), 'contributor' => __('Contributors Navigation', 'simpleportal'), 'subscriber' => __('Subscribers Navigation', 'simpleportal'), 'author' => __('Authors Navigation', 'simpleportal'), 'vertical' => __('Vertical Navigation', 'simpleportal')));
}
コード例 #28
0
ファイル: functions.php プロジェクト: blinkcursor/stockholm
function hanna_child_theme_setup()
{
    load_child_theme_textdomain('hanna-child', get_stylesheet_directory() . '/languages');
}
コード例 #29
0
 /**
  * Load the theme's textdomain, as well as an optional child theme textdomain.
  * @since  2.0.0
  * @return void
  */
 function woo_load_textdomain()
 {
     load_theme_textdomain('woothemes');
     load_theme_textdomain('woothemes', get_template_directory() . '/lang');
     if (function_exists('load_child_theme_textdomain')) {
         load_child_theme_textdomain('woothemes');
     }
 }
コード例 #30
0
ファイル: functions.php プロジェクト: umairakhtar123/hova
<?php

//* Start the engine
include_once get_template_directory() . '/lib/init.php';
//* Setup Theme
include_once get_stylesheet_directory() . '/lib/theme-defaults.php';
//* Set Localization (do not remove)
load_child_theme_textdomain('altitude', apply_filters('child_theme_textdomain', get_stylesheet_directory() . '/languages', 'altitude'));
//* Add Image upload and Color select to WordPress Theme Customizer
require_once get_stylesheet_directory() . '/lib/customize.php';
//* Include Customizer CSS
include_once get_stylesheet_directory() . '/lib/output.php';
//* Child theme (do not remove)
define('CHILD_THEME_NAME', 'Altitude Pro Theme');
define('CHILD_THEME_URL', 'http://my.studiopress.com/themes/altitude/');
define('CHILD_THEME_VERSION', '1.0.0');
//* Enqueue scripts and styles
add_action('wp_enqueue_scripts', 'altitude_enqueue_scripts_styles');
function altitude_enqueue_scripts_styles()
{
    wp_enqueue_script('altitude-global', get_bloginfo('stylesheet_directory') . '/js/global.js', array('jquery'), '1.0.0');
    wp_enqueue_style('dashicons');
    wp_enqueue_style('altitude-google-fonts', '//fonts.googleapis.com/css?family=Ek+Mukta:200,800', array(), CHILD_THEME_VERSION);
}
//* Add HTML5 markup structure
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
//* Add viewport meta tag for mobile browsers
add_theme_support('genesis-responsive-viewport');
//* Add new image sizes
add_image_size('featured-page', 1140, 400, TRUE);
//* Add support for 1-column footer widget area