本文整理汇总了PHP中load_child_theme_textdomain函数的典型用法代码示例。如果您正苦于以下问题:PHP load_child_theme_textdomain函数的具体用法?PHP load_child_theme_textdomain怎么用?PHP load_child_theme_textdomain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_child_theme_textdomain函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: presscore_setup
/**
* 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: kuorinka_child_dev_theme_setup
/**
* 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: goran_setup
/**
* 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: muenchen_child_setup
/**
* 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: venedor_theme_setup
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: everafter_setup
/**
* 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: initComponents
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: pda_theme_setup
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: dreamway_setup
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: hybrid_load_textdomains
/**
* 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: wplms_modern_theme_setup
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: g1_init_localization_before_theme
/**
* 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: presscore_setup
/**
* 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: cubic_setup
/**
* 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: ellak_theme_setup
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);
}
}