本文整理汇总了PHP中get_template_directory_uri函数的典型用法代码示例。如果您正苦于以下问题:PHP get_template_directory_uri函数的具体用法?PHP get_template_directory_uri怎么用?PHP get_template_directory_uri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_template_directory_uri函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: montkailash_scripts
/**
* Enqueue scripts and styles.
*
* @since Twenty Fifteen 1.0
*/
function montkailash_scripts()
{
// Load our main stylesheet.
wp_enqueue_style('bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css');
wp_enqueue_style('bootstrap-style', get_template_directory_uri() . '/css/bootstrap-theme.min.css');
wp_enqueue_style('lightbox-style', get_template_directory_uri() . '/css/lightbox.css');
wp_enqueue_style('montkailash-style', get_stylesheet_uri());
if (is_page('Contact')) {
wp_register_script('gmap', "http://maps.google.com/maps/api/js?sensor=true", '', '', true);
wp_enqueue_script('gmap');
wp_enqueue_script('gmaps', get_template_directory_uri() . '/js/gmaps.js', array('jquery'), '', true);
wp_enqueue_script('function-map', get_template_directory_uri() . '/js/function_map.js', array('jquery'), '0.1', true);
}
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js", '', '1.8.3', true);
wp_enqueue_script('jquery');
wp_deregister_script('wonderplugin-slider-skins-script');
wp_deregister_script('wonderplugin-slider-script');
wp_deregister_script('wonderplugin-slider-creator-script');
wp_deregister_script('woo-vou-public-script');
wp_register_script('wonderplugin-slider-skins-script', plugins_url() . '/wonderplugin-slider/engine/wonderpluginsliderskins.js', array('jquery'), '4.9', true);
wp_register_script('wonderplugin-slider-script', plugins_url() . '/wonderplugin-slider/engine/wonderpluginslider.js', array('jquery'), '4.9', true);
wp_register_script('wonderplugin-slider-creator-script', plugins_url() . '/wonderplugin-slider/app/wonderplugin-slider-creator.js', array('jquery'), '4.9', true);
wp_register_script('woo-vou-public-script', plugins_url() . '/woocommerce-pdf-vouchers/includes/js/woo-vou-public.js', array('jquery'), '2.4.4', true);
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20150330', true);
wp_enqueue_script('lightbox', get_template_directory_uri() . '/js/lightbox.js', array('jquery'), '2.8.1', true);
wp_enqueue_script('montkailash-script', get_template_directory_uri() . '/js/functions.js', array('jquery'), '0.1', true);
}
}
示例2: md_add_footer
function md_add_footer()
{
// Drone JS
wp_register_script('drone', get_template_directory_uri() . '/js/drone.js');
wp_enqueue_script('drone');
wp_localize_script('drone', 'mdajaxurl', array('ajax' => admin_url('admin-ajax.php')));
}
示例3: pitch_slide_init
/**
* Initialize Pitch's slide post type
*/
function pitch_slide_init()
{
$labels = array('name' => _x('Slides', 'post type general name', 'pitch'), 'singular_name' => _x('Slide', 'post type singular name', 'pitch'), 'add_new' => _x('Add New', 'book', 'pitch'), 'add_new_item' => __('Add New Slide', 'pitch'), 'edit_item' => __('Edit Slide', 'pitch'), 'new_item' => __('New Slide', 'pitch'), 'all_items' => __('All Slide', 'pitch'), 'view_item' => __('View Slide', 'pitch'), 'search_items' => __('Search Slides', 'pitch'), 'not_found' => __('No slides found', 'pitch'), 'not_found_in_trash' => __('No slides found in Trash', 'pitch'), 'parent_item_colon' => '', 'menu_name' => __('Slides', 'pitch'));
$args = array('labels' => $labels, 'public' => false, 'publicly_queryable' => false, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => false, 'rewrite' => false, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'thumbnail', 'excerpt', 'page-attributes'), 'menu_icon' => get_template_directory_uri() . '/images/post-types/slider-small.png');
register_post_type('slide', $args);
add_image_size('slide', 960, siteorigin_setting('slider_height'), true);
}
示例4: 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');
}
示例5: twentyhua_10_scripts_styles
function twentyhua_10_scripts_styles()
{
// bootstrap
wp_enqueue_script('twentyhua-script', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20150701', true);
wp_enqueue_style('twentyhua-style', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '20150701');
wp_enqueue_style('twentyhua-style', get_template_directory_uri() . '/css/bootstrap-theme.min.css', array(), '20150701');
}
示例6: add_scripts_after_footer
function add_scripts_after_footer()
{
// Register the script like this for a plugin:
//wp_register_script( 'custom-script', plugins_url( '/js/custom-script.js', __FILE__ ) );
// or
// Register the script like this for a theme:
wp_register_script('jquery1.7', "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js", false);
wp_register_script('bootstrap-alert', get_template_directory_uri() . '/js/bootstrap-alert.js');
wp_register_script('bootstrap-button', get_template_directory_uri() . '/js/bootstrap-button.js');
wp_register_script('bootstrap-carousel', get_template_directory_uri() . '/js/bootstrap-carousel.js');
wp_register_script('bootstrap-collapse', get_template_directory_uri() . '/js/bootstrap-collapse.js');
wp_register_script('bootstrap-dropdown', get_template_directory_uri() . '/js/bootstrap-dropdown.js');
wp_register_script('bootstrap-modal', get_template_directory_uri() . '/js/bootstrap-modal.js');
wp_register_script('bootstrap-popover', get_template_directory_uri() . '/js/bootstrap-popover.js');
wp_register_script('bootstrap-scrollspy', get_template_directory_uri() . '/js/bootstrap-scrollspy.js');
wp_register_script('bootstrap-tab', get_template_directory_uri() . '/js/bootstrap-tab.js');
wp_register_script('bootstrap-tooltip', get_template_directory_uri() . '/js/bootstrap-tooltip.js');
wp_register_script('bootstrap-transition', get_template_directory_uri() . '/js/bootstrap-transition.js');
wp_register_script('bootstrap-typeahead', get_template_directory_uri() . '/js/bootstrap-typeahead.js');
// For either a plugin or a theme, you can then enqueue the script:
wp_enqueue_script('jquery1.7');
wp_enqueue_script('bootstrap-transition');
wp_enqueue_script('bootstrap-alert');
wp_enqueue_script('bootstrap-modal');
wp_enqueue_script('bootstrap-dropdown');
wp_enqueue_script('bootstrap-scrollspy');
wp_enqueue_script('bootstrap-tab');
wp_enqueue_script('bootstrap-tooltip');
wp_enqueue_script('bootstrap-popover');
wp_enqueue_script('bootstrap-button');
wp_enqueue_script('bootstrap-collapse');
wp_enqueue_script('bootstrap-carousel');
wp_enqueue_script('bootstrap-typeahead');
}
示例7: wl_removeScripts
function wl_removeScripts()
{
//De-Queuing Styles sheet
wp_dequeue_style('default', get_template_directory_uri() . '/css/default.css');
//EN-Queing Style sheet
wp_enqueue_style('lite-brown', get_stylesheet_directory_uri() . '/green.css');
}
示例8: dazake_load_script
/**
* Ladda script
*/
function dazake_load_script()
{
if (!is_admin()) {
/**
* Deregister wordpress scripts
*/
wp_deregister_script('jquery');
/**
* wp_register_script( $handle, $src, $deps, $ver, $in_footer );
*/
wp_register_script('jquery', 'http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js');
wp_register_script('modernizr', get_template_directory_uri() . '/js/libs/modernizr.js');
wp_register_script('bootstrap', get_template_directory_uri() . '/js/libs/bootstrap/js/bootstrap.min.js');
wp_register_script('less', get_template_directory_uri() . '/js/libs/less.js');
wp_register_script('main', get_template_directory_uri() . '/js/main.js');
/**
* Laddar skripten vi registrerat ovan.
*/
wp_enqueue_script('jquery');
wp_enqueue_script('modernizr');
wp_enqueue_script('bootstrap');
wp_enqueue_script('less');
wp_enqueue_script('main');
/**
* load stylesheet
*/
wp_enqueue_style('style', get_stylesheet_uri());
wp_enqueue_style('bootstrap', get_template_directory_uri() . '/js/libs/bootstrap/css/bootstrap.min.css');
wp_enqueue_style('bootstrap-responsive', get_template_directory_uri() . '/js/libs/bootstrap/css/bootstrap-responsive.min.css');
}
}
示例9: _s_scripts
/**
* Enqueue scripts and styles.
*/
function _s_scripts()
{
/**
* If WP is in script debug, or we pass ?script_debug in a URL - set debug to true.
*/
$debug = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG == true || isset($_GET['script_debug']) ? true : false;
/**
* If we are debugging the site, use a unique version every page load so as to ensure no cache issues.
*/
$version = '1.0.0';
/**
* Should we load minified scripts? Also enqueue live reload to allow for extensionless reloading.
*/
$suffix = '.min';
if (true === $debug) {
$suffix = '';
wp_enqueue_script('live-reload', '//localhost:35729/livereload.js', array(), $version, true);
}
wp_enqueue_style('_s-google-font', _s_font_url(), array(), null);
wp_enqueue_style('_s-style', get_stylesheet_directory_uri() . '/style' . $suffix . '.css', array(), $version);
wp_enqueue_script('_s-project', get_template_directory_uri() . '/assets/js/project' . $suffix . '.js', array('jquery'), $version, true);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
示例10: ieseg2_scripts
/**
* Enqueue scripts and styles for the front end.
*
* @since Twenty Fourteen 1.0
*/
function ieseg2_scripts()
{
//<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,300,400italic' rel='stylesheet' type='text/css'>
// Add Source Sans.
wp_enqueue_style('ieseg-source-sans', 'http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,300,400italic', array(), null);
// Add Genericons font, used in the main stylesheet.
//wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.2' );
// Load our main stylesheet.
//wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri(), array( 'genericons' ) );
wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', false, '1.0');
wp_enqueue_style('bootstrap-theme', get_template_directory_uri() . '/css/bootstrap-theme.min.css', array('bootstrap'), '1.0');
wp_enqueue_style('animate', get_template_directory_uri() . '/css/animate.css', false, '1.0');
// utile pour wow.js
wp_enqueue_style('style-ieseg', get_template_directory_uri() . '/css/ieseg.min.css', array('bootstrap'), '1.0');
if (is_page(array(1766, 59))) {
wp_enqueue_style('style-timeline', get_template_directory_uri() . '/css/timeline.css');
}
//wp_enqueue_style('fancybox','/wp-content/themes/'.get_template().'/lib/fancybox/jquery.fancybox-1.3.4.css',false,'1.0');
// Load the Internet Explorer specific stylesheet.
//wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style', 'genericons' ), '20131205' );
//wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' );
//BX slider
if (is_front_page() || is_page_template('template-page-programs.php')) {
wp_enqueue_script('bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '1.0', true);
wp_enqueue_style('style-bxslider', get_template_directory_uri() . '/css/jquery.bxslider.css', array('style-ieseg'), '1.0');
}
wp_enqueue_script('ieseg-script', get_template_directory_uri() . '/js/ieseg.js', array('jquery'), '1.0', true);
wp_enqueue_script('bootstrap-script', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '1.0', true);
wp_enqueue_script('wow', get_template_directory_uri() . '/js/wow.min.js', array('jquery'), '1.0', true);
//wp_enqueue_script( 'responsive-nav', get_template_directory_uri() . '/js/responsive-nav.min.js', array( 'jquery' ), '1.0', true ); //menu de gauche responsive
if (is_page(array('mib-class-profile', 'mib-career-opportunities', 'mfm-student-profiles', 'msc-digital-marketing-crm-class-profile', 'msc-business-analysis-consulting-class-profile', 'msc-accounting-audit-control', 'msc-finance-class-profile', 'msc-banking-capital-markets-class-profile', 'msc-in-negotiation-for-organizations-class-profile', 'msc-big-data-analytics-business-class-profile', 'imba-class-profile', 'programme-grande-ecole', 33306, 33325))) {
wp_enqueue_script('classprofiles', get_bloginfo('template_directory') . '/js/classprofiles.js', array(), '1.1', true);
}
}
示例11: enqueue
/**
* Enqueue the styles and scripts
**/
public function enqueue()
{
// styles
wp_enqueue_style('lsx-font-picker-custom-control', get_template_directory_uri() . '/css/customizer-font.css');
// scripts
wp_enqueue_script('lsx-font-picker-custom-control', get_template_directory_uri() . '/js/customizer-font.js');
}
示例12: theme_scripts_with_jquery
function theme_scripts_with_jquery()
{
// For either a plugin or a theme, you can then enqueue the script:
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'), '', true);
wp_enqueue_script('camera_js', get_template_directory_uri() . '/js/camera.js', array(), '', true);
wp_enqueue_script('superfish_js', get_template_directory_uri() . '/js/superfish.js', array(), '', true);
}
示例13: kingjoytravel_js
function kingjoytravel_js()
{
global $wp_scripts;
wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), '', true);
wp_enqueue_script('fastclick-js', get_template_directory_uri() . '/js/vendor/fastclick.js', '', '', true);
wp_enqueue_script('app-js', get_template_directory_uri() . '/js/app.js', '', '', true);
}
示例14: fb_add_tinymce_plugin
function fb_add_tinymce_plugin($plugin_array)
{
$plugin_array['td_shortcode_plugin'] = get_template_directory_uri() . '/includes/wp_booster/wp-admin/tinymce/customcodes.js';
// Print all plugin js path
//var_dump( $plugin_array );
return $plugin_array;
}
示例15: twentythirteen_custom_header_fonts
/**
* Load our special font CSS files.
*
* @since Twenty Thirteen 1.0
*/
function twentythirteen_custom_header_fonts()
{
// Add Source Sans Pro and Bitter fonts.
wp_enqueue_style('twentythirteen-fonts', twentythirteen_fonts_url(), array(), null);
// Add Genericons font.
wp_enqueue_style('genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.03');
}