• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_template_directory函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_template_directory函数的典型用法代码示例。如果您正苦于以下问题:PHP get_template_directory函数的具体用法?PHP get_template_directory怎么用?PHP get_template_directory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_template_directory函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: includes

 private function includes()
 {
     $parent = get_template_directory() . '/setup/';
     $child = get_stylesheet_directory() . '/setup/';
     require_once $parent . 'class.install.php';
     require_once $parent . 'class.uw-scripts.php';
     require_once $parent . 'class.uw-styles.php';
     require_once $parent . 'class.uw-dropdowns.php';
     require_once $parent . 'class.images.php';
     require_once $parent . 'class.squish_bugs.php';
     require_once $parent . 'class.filters.php';
     require_once $parent . 'class.uw-oembeds.php';
     require_once $parent . 'class.googleapps.php';
     require_once $parent . 'class.mimes.php';
     require_once $parent . 'class.users.php';
     require_once $parent . 'class.dropdowns_walker.php';
     // no initialization needed because it extends a WP class
     require_once $parent . 'class.uw-basic-custom-post.php';
     // no initialization needed unless a child theme makes one
     require_once $parent . 'class.uw-sidebar-menu-walker.php';
     // sidebar menu will initialize for us
     require_once $parent . 'class.uw-quicklinks.php';
     require_once $parent . 'class.uw-iframes.php';
     require_once $parent . 'class.uw-shortcodes.php';
     require_once $parent . 'class.uw-media-credit.php';
     require_once $parent . 'class.uw-media-caption.php';
     require_once $parent . 'class.uw-replace-media.php';
     require_once $parent . 'class.uw-tinymce.php';
     require_once $parent . 'class.uw-documentation-dashboard-widget.php';
     require_once $parent . 'class.uw-enclosure.php';
     require_once $parent . 'class.uw-carousel.php';
     require_once $parent . 'class.uw-settings.php';
 }
开发者ID:uweb,项目名称:uw-polr,代码行数:33,代码来源:class.uw.php


示例2: constants

 function constants($options)
 {
     define("THEME_DIR", get_template_directory());
     define("THEME_DIR_URI", get_template_directory_uri());
     define("THEME_NAME", $options["theme_name"]);
     if (defined("ICL_LANGUAGE_CODE")) {
         $lang = "_" . ICL_LANGUAGE_CODE;
     } else {
         $lang = "";
     }
     define("THEME_OPTIONS", $options["theme_name"] . '_options' . $lang);
     define("THEME_SLUG", $options["theme_slug"]);
     define("THEME_STYLES", THEME_DIR_URI . "/stylesheet/css");
     define("THEME_IMAGES", THEME_DIR_URI . "/images");
     define("THEME_JS", THEME_DIR_URI . "/js");
     define('FONTFACE_DIR', THEME_DIR . '/fontface');
     define('FONTFACE_URI', THEME_DIR_URI . '/fontface');
     define("THEME_FRAMEWORK", THEME_DIR . "/framework");
     define("THEME_PLUGINS", THEME_FRAMEWORK . "/plugins");
     define("THEME_ACTIONS", THEME_FRAMEWORK . "/actions");
     define("THEME_PLUGINS_URI", THEME_DIR_URI . "/framework/plugins");
     define("THEME_SHORTCODES", THEME_FRAMEWORK . "/shortcodes");
     define("THEME_WIDGETS", THEME_FRAMEWORK . "/widgets");
     define("THEME_SLIDERS", THEME_FRAMEWORK . "/sliders");
     define("THEME_HELPERS", THEME_FRAMEWORK . "/helpers");
     define("THEME_FUNCTIONS", THEME_FRAMEWORK . "/functions");
     define("THEME_CLASSES", THEME_FRAMEWORK . "/classes");
     define('THEME_ADMIN', THEME_FRAMEWORK . '/admin');
     define('THEME_METABOXES', THEME_ADMIN . '/metaboxes');
     define('THEME_ADMIN_POST_TYPES', THEME_ADMIN . '/post-types');
     define('THEME_GENERATORS', THEME_ADMIN . '/generators');
     define('THEME_ADMIN_URI', THEME_DIR_URI . '/framework/admin');
     define('THEME_ADMIN_ASSETS_URI', THEME_DIR_URI . '/framework/admin/assets');
 }
开发者ID:kevalbaxi,项目名称:dosomething-blog,代码行数:34,代码来源:functions.php


示例3: activello_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 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');
 }
开发者ID:RickyG-Akl,项目名称:Activello,代码行数:42,代码来源:functions.php


示例4: omega_theme_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 post thumbnails.
 */
function omega_theme_setup()
{
    //remove_theme_mods();
    /* Load omega functions */
    require get_template_directory() . '/lib/functions/hooks.php';
    add_theme_support('title-tag');
    /* Load scripts. */
    add_theme_support('omega-scripts', array('comment-reply'));
    add_theme_support('post-thumbnails');
    add_theme_support('omega-theme-settings');
    add_theme_support('omega-content-archives');
    /* implement editor styling, so as to make the editor content match the resulting post output in the theme. */
    add_editor_style();
    /* Support pagination instead of prev/next links. */
    add_theme_support('loop-pagination');
    /* Add default posts and comments RSS feed links to <head>.  */
    add_theme_support('automatic-feed-links');
    /* Enable wraps */
    add_theme_support('omega-wraps');
    /* Enable custom post */
    add_theme_support('omega-custom-post');
    /* Enable custom css */
    add_theme_support('omega-custom-css');
    /* Enable custom logo */
    add_theme_support('omega-custom-logo');
    /* Enable child themes page */
    add_theme_support('omega-child-page');
    /* Handle content width for embeds and images. */
    omega_set_content_width(700);
}
开发者ID:davidgilman,项目名称:Live2Give,代码行数:37,代码来源:functions.php


示例5: alm_get_default_repeater

function alm_get_default_repeater()
{
    global $wpdb;
    $file = null;
    $template_dir = 'alm_templates';
    // Allow user to load template from theme directory
    // Since 2.8.5
    // load repeater template from current theme folder
    if (is_child_theme()) {
        $template_theme_file = get_stylesheet_directory() . '/' . $template_dir . '/default.php';
        // if child theme does not have repeater template, then use the parent theme dir
        if (!file_exists($template_theme_file)) {
            $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php';
        }
    } else {
        $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php';
    }
    // if theme or child theme contains the template, use that file
    if (file_exists($template_theme_file)) {
        $file = $template_theme_file;
    }
    // Since 2.0
    // otherwise use pre-defined plug-in templates
    if ($file == null) {
        $blog_id = $wpdb->blogid;
        if ($blog_id > 1) {
            $file = ALM_PATH . 'core/repeater/' . $blog_id . '/default.php';
            // File
        } else {
            $file = ALM_PATH . 'core/repeater/default.php';
        }
    }
    return $file;
}
开发者ID:OneTimeUser,项目名称:retailwire,代码行数:34,代码来源:functions.php


示例6: mr_locate_template

/**
 * Retrieve the name of the highest priority template file that exists.
 *
 * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
 * inherit from a parent theme can just overload one file. If the template is
 * not found in either of those, it looks in the theme-compat folder last.
 *
 * Taken from bbPress
 *
 * @since v2.5
 *
 * @param string|array $template_names Template file(s) to search for, in order.
 * @param bool $load If true the template file will be loaded if it is found.
 * @param bool $require_once Whether to require_once or require. Default true.
 *                            Has no effect if $load is false.
 * @return string The template filename if one is located.
 */
function mr_locate_template($template_names, $load = false, $require_once = true, $template_vars)
{
    // No file found yet
    $located = false;
    // Try to find a template file
    foreach ((array) $template_names as $template_name) {
        // Continue if template is empty
        if (empty($template_name)) {
            continue;
        }
        // Trim off any slashes from the template name
        $template_name = ltrim($template_name, '/');
        // Check child theme first
        if (file_exists(trailingslashit(get_stylesheet_directory()) . 'multi-rating/' . $template_name)) {
            $located = trailingslashit(get_stylesheet_directory()) . 'multi-rating/' . $template_name;
            break;
            // Check parent theme next
        } elseif (file_exists(trailingslashit(get_template_directory()) . 'multi-rating/' . $template_name)) {
            $located = trailingslashit(get_template_directory()) . 'multi-rating/' . $template_name;
            break;
            // Check theme compatibility last
        } elseif (file_exists(trailingslashit(mr_get_templates_dir()) . $template_name)) {
            $located = trailingslashit(mr_get_templates_dir()) . $template_name;
            break;
        }
    }
    if (true == $load && !empty($located)) {
        mr_load_template($located, $require_once, $template_vars);
    }
    return $located;
}
开发者ID:ratheeshpkr,项目名称:multi-rating,代码行数:48,代码来源:template-functions.php


示例7: bones_ahoy

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');
}
开发者ID:WilliamWorkman,项目名称:House-Martin,代码行数:28,代码来源:functions.php


示例8: load_controller_directories

 /**
  * load_controller_directories.
  * Goes through the theme and active plugins to check whether it has a wp-controllers directory
  * and adds this to the internal directories
  */
 private static function load_controller_directories()
 {
     self::$_directories = array(__DIR__ . '/controllers');
     $parent_theme = get_template_directory();
     $child_theme = get_stylesheet_directory();
     // Check & add child theme
     if ($parent_theme !== $child_theme) {
         $child_theme = apply_filters('wp_controllers_child_theme_directory', "{$child_theme}/wp-controllers");
         if (is_dir($child_theme)) {
             self::$_directories[] = $child_theme;
         }
     }
     // Check & add main/parent theme
     $parent_theme = apply_filters('wp_controllers_theme_directory', "{$parent_theme}/wp-controllers");
     if (is_dir($parent_theme)) {
         self::$_directories[] = $parent_theme;
     }
     // Include necessary plugin functions if front-end
     if (!function_exists('get_plugins')) {
         include_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     // Check & add active plugins
     $plugins = get_plugins();
     $plugins_path = WP_PLUGIN_DIR;
     foreach ($plugins as $path => $data) {
         if (is_plugin_active($path) && basename($path) !== basename(__FILE__)) {
             $path = strstr($path, DIRECTORY_SEPARATOR, true);
             $directory = apply_filters('wp_controllers_plugin_directory', "{$plugins_path}/{$path}/wp-controllers", $path, $data);
             if (is_dir($directory)) {
                 self::$_directories[] = $directory;
             }
         }
     }
 }
开发者ID:JasonTheAdams,项目名称:WP-Controllers,代码行数:39,代码来源:wp-controllers.php


示例9: az_theme_setup

 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');
 }
开发者ID:Truthkingdom,项目名称:website-jnatera,代码行数:25,代码来源:functions.php


示例10: include_required_files

 private function include_required_files()
 {
     /**
      * If Kirki is not already installed, use the included version
      */
     if (!class_exists('Kirki')) {
         require get_template_directory() . '/inc/kirki/kirki.php';
     }
     /**
      * Customizer additions.
      */
     require get_template_directory() . '/inc/customizer.php';
     /**
      * Include additional theme classes
      */
     require get_template_directory() . '/inc/squarely-layout.php';
     require get_template_directory() . '/inc/squarely-scripts.php';
     /**
      * Load Jetpack compatibility file.
      */
     require get_template_directory() . '/inc/jetpack.php';
     /**
      * If jetpack is not installed then we need to include its site-logo module
      */
     if (!function_exists('site_logo_init')) {
         require get_template_directory() . '/inc/site-logo.php';
     }
 }
开发者ID:jessicahawkins3344,项目名称:squarely,代码行数:28,代码来源:options.php


示例11: cartel_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 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'));
 }
开发者ID:Arkon13,项目名称:magazin2,代码行数:38,代码来源:functions.php


示例12: red_starter_minified_css

/**
 * Filter the stylesheet_uri to output the minified CSS file.
 */
function red_starter_minified_css($stylesheet_uri, $stylesheet_dir_uri)
{
    if (file_exists(get_template_directory() . '/build/css/style.min.css')) {
        $stylesheet_uri = $stylesheet_dir_uri . '/build/css/style.min.css';
    }
    return $stylesheet_uri;
}
开发者ID:DuyTr,项目名称:project08-client-project,代码行数:10,代码来源:functions.php


示例13: toolbox_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 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'));
 }
开发者ID:rajankz,项目名称:webspace,代码行数:37,代码来源:functions.php


示例14: themeInit

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');
}
开发者ID:BILconference,项目名称:bil-theme,代码行数:25,代码来源:init.php


示例15: setup

/**
 * 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'));
}
开发者ID:msoroeta,项目名称:theme-name,代码行数:36,代码来源:setup.php


示例16: minileven_setup

 /**
  * 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');
 }
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:35,代码来源:functions.php


示例17: roots_add_rewrites

function roots_add_rewrites($content)
{
    $theme_name = next(explode('/themes/', get_template_directory()));
    global $wp_rewrite;
    $roots_new_non_wp_rules = array('css/(.*)' => 'wp-content/themes/' . $theme_name . '/css/$1', 'js/(.*)' => 'wp-content/themes/' . $theme_name . '/js/$1', 'img/(.*)' => 'wp-content/themes/' . $theme_name . '/img/$1', 'plugins/(.*)' => 'wp-content/plugins/$1');
    $wp_rewrite->non_wp_rules += $roots_new_non_wp_rules;
}
开发者ID:herrhaase,项目名称:roots,代码行数:7,代码来源:roots-cleanup.php


示例18: eryn_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 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));
 }
开发者ID:COfrost,项目名称:www.example.dev,代码行数:41,代码来源:functions.php


示例19: ktz_definitions

 public static function ktz_definitions()
 {
     /* 
      * Get slug for kentooz framework look @ define( 'ktz_theme_textdomain', ktz_theme_slug );
      */
     define('ktz_theme_slug', get_template());
     /* 
      * Retrieves the absolute path to the directory of the current theme, without the trailing slash.
      * ktz or kentooz use directory /includes for all function
      */
     define('ktz_dir', get_template_directory() . '/');
     define('ktz_inc', get_template_directory() . '/includes/');
     /* 
      * Retrieve template directory URI for the current theme. Checks for SSL.
      * Note: Does not return a trailing slash following the directory address. 
      * This can use path for JS, stylesheet, or image
      * ktz or kentooz use directory /includes for all function
      */
     define('ktz_url', get_template_directory_uri() . '/');
     define('ktz_styleinc', get_template_directory_uri() . '/includes/');
     /* 
      * Get locale or translating for kentooz framework
      */
     define('ktz_theme_textdomain', ktz_theme_slug);
 }
开发者ID:gigikir,项目名称:adebe,代码行数:25,代码来源:init.php


示例20: _act_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 _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);
 }
开发者ID:ambercouch,项目名称:ac_timber,代码行数:35,代码来源:functions--theme-setup.php



注:本文中的get_template_directory函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_template_directory_uri函数代码示例发布时间:2022-05-15
下一篇:
PHP get_template函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap