本文整理汇总了PHP中asset_path函数的典型用法代码示例。如果您正苦于以下问题:PHP asset_path函数的具体用法?PHP asset_path怎么用?PHP asset_path使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了asset_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assets
function assets()
{
wp_enqueue_style('sage_css', asset_path('styles/main.css'), false, null);
wp_enqueue_script('modernizr', asset_path('scripts/modernizr.js'), [], null, true);
wp_enqueue_script('sage_js', asset_path('scripts/main.js'), ['jquery'], null, true);
wp_enqueue_script('wikiverse', get_stylesheet_directory_uri() . '/assets/wikiverse.js', [], null, true);
wp_enqueue_script('gmaps', 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&signed_in=true', [], null, false);
wp_enqueue_script('soundcloud', '//connect.soundcloud.com/sdk-2.0.0.js', [], null, false);
wp_enqueue_script('soundcloud_player', '//w.soundcloud.com/player/api.js', [], null, false);
wp_enqueue_style('font_awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css', false, null, false);
}
示例2: 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');
//add_theme_support('soil-js-to-footer');
// 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(\asset_path('styles/main.css'));
}
示例3: smarty_function_mtcommenteruserpic
function smarty_function_mtcommenteruserpic($args, &$ctx)
{
$comment = $ctx->stash('comment');
if (!$comment) {
return $ctx->error("No comment available");
}
$cmntr = $ctx->stash('commenter');
if (!$cmntr) {
return '';
}
$asset_id = isset($cmntr['author_userpic_asset_id']) ? $cmntr['author_userpic_asset_id'] : 0;
$asset = $ctx->mt->db->fetch_assets(array('id' => $asset_id));
if (!$asset) {
return '';
}
$blog =& $ctx->stash('blog');
require_once "MTUtil.php";
$userpic_url = userpic_url($asset[0], $blog, $cmntr);
if (empty($userpic_url)) {
return '';
}
$asset_path = asset_path($asset[0]['asset_file_path'], $blog);
list($src_w, $src_h, $src_type, $src_attr) = getimagesize($asset_path);
$dimensions = sprintf('width="%s" height="%s"', $src_w, $src_h);
$link = sprintf('<img src="%s" %s alt="%s" />', encode_html($userpic_url), $dimensions, encode_html($asset['label']));
return $link;
}
示例4: dreams_scripts_and_styles
function dreams_scripts_and_styles()
{
if (!is_admin()) {
global $themename, $prefix;
//Versions Variables
$jsPath = asset_path('js', 'main.min.js');
$cssPath = asset_path('css', 'main.min.css');
$mainVer = '1.0.0';
$cssVer = '1.0';
$jQver = '2.1.4';
$mdzver = '2.8.3';
$fontAwesome = '4.3.0';
$jQui = '1.11.4';
$ajaxify = array('ajaxurl' => admin_url('admin-ajax.php'));
wp_enqueue_style('style', get_template_directory_uri() . '/resources/css/' . $cssPath . '', false, '', 'all');
wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/' . $fontAwesome . '/css/font-awesome.min.css', false, '', 'all');
//Deregister Scripts
wp_deregister_script('jquery');
//Register Scripts
/* Modernizr */
wp_enqueue_script('dreams-modernizr', get_template_directory_uri() . '/inc/scripts/vendor/modernizr.min.js', '', '', false);
/* Jquery */
wp_enqueue_script('dreams-jquery', '//ajax.googleapis.com/ajax/libs/jquery/' . $jQver . '/jquery.min.js', array('dreams-modernizr'), '', true);
/* Vendor */
/* Plugins.jQuery */
wp_register_script('dreams-main', get_template_directory_uri() . '/resources/js/' . $jsPath . '', array('dreams-jquery', 'dreams-modernizr'), '', true);
//Enqueue Scripts
wp_enqueue_script('dreams-modernizr');
wp_enqueue_script('dreams-jquery');
//wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('dreams-main');
}
}
示例5: assets
function assets()
{
wp_enqueue_style('mZ_mindbody_schedule_bs', asset_path('styles/main.css'), false, null);
wp_enqueue_script('modernizr', asset_path('scripts/modernizr.js'), array(), null, true);
wp_enqueue_script('mz_mbo_bootstrap_script', asset_path('scripts/main.js'), array('jquery'), null, true);
wp_localize_script('mz_mbo_bootstrap_script', 'mz_mindbody_api_i18n', array('filter_default' => __('by teacher, class type', 'mz-mindbody-api'), 'quick_1' => __('morning', 'mz-mindbody-api'), 'quick_2' => __('afternoon', 'mz-mindbody-api'), 'quick_3' => __('evening', 'mz-mindbody-api'), 'label' => __('Filter', 'mz-mindbody-api')));
}
示例6: backend_enqueue
function backend_enqueue($hook)
{
if ('edit.php' != $hook && get_post_type() != 'medic') {
return;
}
wp_enqueue_script('poli_script', asset_path('scripts/poli.js'), ['jquery'], null, true);
add_action('wp_after_admin_bar_render', __NAMESPACE__ . '\\enqueue_orar_modal');
}
示例7: __construct
public function __construct($table)
{
$this->table = $table;
parent::__construct();
$this->images_path = asset_path() . "/images/{$this->entity_name}/";
$this->images_url = asset_url() . "/images/{$this->entity_name}/";
$this->table_fields = array_flip($this->db->list_fields($table));
}
示例8: assets
function assets()
{
wp_enqueue_style('sage_css', asset_path('styles/main.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('sage_js', asset_path('scripts/main.js'), ['jquery'], null, true);
}
示例9: assets
function assets()
{
wp_enqueue_style('sage_fonts', asset_path('fonts/font.css'), false, null);
wp_enqueue_style('sage_css', asset_path('stylesheets/style.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('sage_js', asset_path('javascripts/main.js'), array('jquery'), null, true);
}
示例10: assets
function assets()
{
wp_enqueue_style('sage/css', asset_path('main.css', 'styles/'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('modernizr', asset_path('modernizr.js'), [], null, true);
wp_enqueue_script('sage/js', asset_path('main.js', 'scripts/'), [], null, true);
}
示例11: assets
function assets()
{
wp_enqueue_style('sage_css', asset_path('css/kickoff.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('modernizr', asset_path('js/libs//modernizr.min.js'), [], null, true);
wp_enqueue_script('sage_js', asset_path('js/script.js'), ['jquery'], null, true);
}
示例12: assets
function assets()
{
wp_enqueue_style('sage/css/font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css', false, null);
wp_enqueue_style('sage/css', asset_path('styles/main.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('modernizr', asset_path('scripts/modernizr.js'), [], null, true);
wp_enqueue_script('sage/js', asset_path('scripts/main.js'), ['jquery'], null, true);
}
示例13: assets
function assets()
{
wp_enqueue_style('sage_css', asset_path('styles/main.css'), false, null);
wp_enqueue_style('fontawesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css', false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('modernizr', asset_path('scripts/modernizr.js'), [], null, true);
wp_enqueue_script('sage_js', asset_path('scripts/main.js'), ['jquery'], null, true);
}
示例14: assets
function assets()
{
wp_enqueue_style('sage_css', asset_path('styles/main.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('modernizr', asset_path('scripts/modernizr.js'), [], null, true);
wp_enqueue_script('sage_js', asset_path('scripts/main.js'), ['jquery'], null, true);
wp_localize_script('sage_js', 'vars', array('ajaxurl' => admin_url('admin-ajax.php')));
}
示例15: assets
function assets()
{
wp_enqueue_style('sage_css', asset_path('styles/main.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('modernizr', asset_path('scripts/modernizr.js'), [], null, true);
wp_enqueue_script('sage_js', asset_path('scripts/main.js'), ['jquery'], null, true);
wp_enqueue_script('progress-bar', asset_path('scripts/progress-bar.js'), ['jquery'], null, true);
wp_enqueue_script('form-validation', asset_path('scripts/form-validation.js'), ['jquery'], null, true);
}