本文整理汇总了PHP中Roots\Sage\Assets\asset_path函数的典型用法代码示例。如果您正苦于以下问题:PHP asset_path函数的具体用法?PHP asset_path怎么用?PHP asset_path使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了asset_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('roboto/material', '//fonts.googleapis.com/css?family=Material+Icons|Roboto+Slab|Roboto:400,500,300,700', false, null);
// wp_enqueue_style('roboto/font', '//fonts.googleapis.com/css?family=Roboto+Slab:400,700,300|Roboto:400,500,700,900,300', false, null );
// wp_enqueue_style('material/font', '//fonts.googleapis.com/icon?family=Material+Icons', false, null );
wp_enqueue_style('blueprint/css', Assets\asset_path('styles/main.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('blueprint/js', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
}
示例2: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('google_fonts', '//fonts.googleapis.com/css?family=Open+Sans:400,300,700&subset=latin,cyrillic', false, null);
wp_enqueue_style('sage/css', Assets\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', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
/** Localize Scripts */
$php_array = array('admin_ajax' => admin_url('admin-ajax.php'));
wp_localize_script('sage/js', 'php_array', $php_array);
}
示例3: setup
/**
* Theme setup
*/
function setup()
{
global $redux_demo;
$options = $redux_demo;
// 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')]);
// Add 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');
add_image_size('slider', 1200, 600, true);
update_option('medium_crop', 0);
update_option('large_crop', 0);
// Add post formats
// http://codex.wordpress.org/Post_Formats
//add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
// Add HTML5 markup for captions
// http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
add_theme_support('html5', ['caption', 'comment-form', 'comment-list']);
// Tell the TinyMCE editor to use a custom stylesheet
add_editor_style(Assets\asset_path('styles/editor-style.css'));
// Allow shortcode execution in widgets
add_filter('widget_text', 'do_shortcode');
}
示例4: custom_admin_assets
function custom_admin_assets()
{
if (class_exists('Roots\\Sage\\Assets')) {
wp_enqueue_style('admin-style', Assets\asset_path('styles/admin-style.css'));
wp_enqueue_script('admin-script', Assets\asset_path('scripts/admin-script.js'));
}
}
示例5: setup
/**
* Theme setup
*/
function setup()
{
// 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(['sobre-topo' => 'Menu "Sobre" do topo das páginas', 'sobre-footer' => 'Menu "Sobre" do rodapé das páginas', 'software-topo' => 'Menu "Software" do topo das páginas', 'software-footer' => 'Menu "Software" do rodapé das páginas', 'software-home' => 'Botões da seção "Software" da home', 'cursos-topo' => 'Menu "Cursos" do topo das páginas', 'cursos-footer' => 'Menu "Cursos" do rodapé das páginas', 'cursos-home' => 'Botões da seção "Cursos" da home', 'rede-topo' => 'Menu "Rede" do topo das páginas', 'rede-footer' => 'Menu "Rede" do rodapé das páginas', 'rede-home' => 'Botões da seção "Rede" da home']);
// Add 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');
// Add post formats
// http://codex.wordpress.org/Post_Formats
add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
// Add HTML5 markup for captions
// http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
add_theme_support('html5', ['caption', 'comment-form', 'comment-list']);
// Tell the TinyMCE editor to use a custom stylesheet
add_editor_style(Assets\asset_path('styles/editor-style.css'));
}
示例6: setup
/**
* Theme setup
*/
function setup()
{
// Make theme available for translation
// Community translations can be found at https://github.com/roots/rubi-translations
load_theme_textdomain('rubi', 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', 'rubi')]);
// Add 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');
// Add post formats
// http://codex.wordpress.org/Post_Formats
add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
// Add HTML5 markup for captions
// http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
add_theme_support('html5', ['caption', 'comment-form', 'comment-list']);
// Tell the TinyMCE editor to use a custom stylesheet
add_editor_style(Assets\asset_path('styles/editor-style.css'));
}
示例7: front_page_scripts
/**
* Aggiungo uno script in homepage
*/
function front_page_scripts()
{
if (is_front_page()) {
wp_enqueue_script('frontpage.js', Assets\asset_path('scripts/frontpage.js'), ['jquery']);
wp_enqueue_script('gsap.js', Assets\asset_path('scripts/gsap.js'));
wp_enqueue_script('scrollmagic.js', Assets\asset_path('scripts/scrollmagic.js'));
}
}
示例8: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('pressbooks-publisher/css', Assets\asset_path('styles/main.css'), false, null);
wp_enqueue_style('pressbooks-publisher/fonts', 'https://fonts.googleapis.com/css?family=Droid+Sans|Droid+Serif:400,400italic,700|Oswald', false, null);
wp_enqueue_script('pressbooks-publisher/skip-link-focus-fix', Assets\asset_path('scripts/skip-link-focus-fix.js'), [], null, true);
wp_enqueue_script('pressbooks-publisher/match-height', Assets\asset_path('scripts/matchheight.js'), ['jquery'], null, true);
wp_enqueue_script('pressbooks-publisher/js', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
}
示例9: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('sage/css', Assets\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', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
}
示例10: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('sage/css', Assets\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', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
wp_localize_script('sage/js', 'themeUri', array('pages' => trailingslashit(get_template_directory_uri()) . 'pages/', 'templates' => trailingslashit(get_template_directory_uri()) . 'templates/'));
}
示例11: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('wpb-google-fonts', 'href="https://fonts.googleapis.com/css?family=Raleway:400,100,200,300,600,700,900,800,500|Montserrat:400,700"', false);
wp_enqueue_style('sage/css', Assets\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', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
}
示例12: setup
/**
* Theme setup
*/
function setup()
{
// 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', 'odfw')]);
// Add 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');
add_image_size('hero', 1600, 580, true);
add_image_size('grid', 255, 185, true);
add_image_size('listing', 116, 63, false);
add_filter('image_size_names_choose', function ($sizes) {
return array_merge($sizes, array("listing" => __("Listing"), "grid" => __("Grid")));
});
//if(get_option('medium_size_w')!=640) update_option('medium_size_w',640);
//if(get_option('medium_size_h')!=320) update_option('medium_size_h',320);
if (get_option('large_size_w') != 750) {
update_option('large_size_w', 750);
}
if (get_option('large_size_h') != 9999) {
update_option('large_size_h', 9999);
}
// Defaults for inserting images
update_option('image_default_align', 'none');
update_option('image_default_link_type', 'none');
update_option('image_default_size', 'large');
update_option('upload_path', $_SERVER['DOCUMENT_ROOT'] . '/media');
update_option('upload_url_path', 'http://' . $_SERVER['SERVER_NAME'] . '/media');
add_filter('jpeg_quality', function ($arg) {
return 75;
});
// Add post formats
// http://codex.wordpress.org/Post_Formats
add_theme_support('post-formats', ['gallery']);
// Add HTML5 markup for captions
// http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
add_theme_support('html5', ['caption']);
// Tell the TinyMCE editor to use a custom stylesheet
add_editor_style(Assets\asset_path('styles/editor-style.css'));
/* Doesn't need to be set over and over again so commented for now
// We need the medium and large image sizes to be cropped.
if(false === get_option("medium_crop")):
add_option("medium_crop", "1");
else:
update_option("medium_crop", "1");
endif;
*/
}
示例13: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('sage/css', Assets\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', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
wp_enqueue_script('sage/ScrollToFixed_js', Assets\asset_path('scripts/jquery-scrolltofixed-min.js'), ['jquery'], null, true);
// wp_enqueue_script('sage/uisearch_js', Assets\asset_path('scripts/uisearch.js'), ['jquery'], null, true);
}
示例14: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('sage/css', Assets\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', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
wp_enqueue_script('flexslider/js', Assets\asset_path('scripts/flexslider-config.js'), ['jquery'], null, true);
wp_enqueue_script('blueimp-gallery/js', Assets\asset_path('scripts/blueimp-gallery-config.js'), ['jquery'], null, true);
}
示例15: assets
/**
* Theme assets
*/
function assets()
{
wp_enqueue_style('sage/css', Assets\asset_path('styles/main.css'), false, null);
wp_enqueue_style('animate', Assets\asset_path('styles/animate.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('sage/js', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
wp_enqueue_script('gsap-js', 'http://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenLite.min.js', array(), false, true);
}