本文整理匯總了PHP中is_page_template函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_page_template函數的具體用法?PHP is_page_template怎麽用?PHP is_page_template使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_page_template函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bootstrap_breadcrumbs
/**
* Add breadcrumbs functionality to your WordPress theme
*
* Once you have included the function in your functions.php file
* you can then place the following anywhere in your theme templates
* if(function_exists('bootstrap_breadcrumbs')) bootstrap_breadcrumbs();
*
* credit to: c.bavota - http://bavotasan.com (thanks for the code start)
*/
function bootstrap_breadcrumbs()
{
echo '<ol class="breadcrumb">';
echo '<li><a href="' . home_url('/') . '">Home</a></li>';
// are we at "blog home"?
if (is_home()) {
echo '<li><a href="#">Blogs</a></li>';
}
// where else do we want breadcrumbs
if (!is_page_template('pt-home.php') && !is_home()) {
// check if we're in a commerce plugin
if (function_exists('is_woocommerce') && is_woocommerce()) {
echo '<li><a href="/publications/order/">Shop</a></li>';
$product_cats = wp_get_post_terms(get_the_ID(), 'product_cat');
echo '<li><a href="/publications/order/' . str_replace(" ", "-", $product_cats[0]->name) . '">' . $product_cats[0]->name . '</a></li>';
}
// breadcrumb wordpress structures
if (is_category() || is_single() || is_single('aof')) {
if (get_the_category()) {
$category = get_the_category();
echo '<li><a href="/blog/category/' . str_replace(" ", "-", $category[0]->cat_name) . '">' . $category[0]->cat_name . '</a></li>';
}
if (is_single()) {
echo '<li class="active">';
the_title();
echo '</li>';
}
} elseif (is_page()) {
echo '<li class="active">';
the_title();
echo '</li>';
}
}
echo '</ol>';
}
示例2: blackoot_content_width
function blackoot_content_width()
{
global $content_width;
if (is_page_template('page-full-width.php')) {
$content_width = 920;
}
}
示例3: site_scripts
function site_scripts()
{
global $wp_styles;
// Call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way
// Load What-Input files in footer
wp_enqueue_script('what-input', get_template_directory_uri() . '/vendor/what-input/what-input.min.js', array(), '', true);
// Adding Foundation scripts file in the footer
wp_enqueue_script('foundation-js', get_template_directory_uri() . '/assets/js/foundation.min.js', array('jquery'), '6.0', true);
wp_enqueue_script('sticky-js', get_template_directory_uri() . '/assets/js/jquery.sticky.js', array('jquery'), '6.0', true);
// Adding Owl Carousel script file in the footer
wp_enqueue_script('owl-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.js', array('jquery'), '', true);
//Google MAps API
if (is_page('about-us') || is_page('contact-us')) {
wp_enqueue_script('maps-js', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBTfVURGZR7YFppqYW9LVpRCk0xmup0YSg', array('jquery'), '', true);
wp_enqueue_script('custom-maps-js', get_template_directory_uri() . '/assets/js/mapScripts.js', array('jquery'), '', true);
}
if (is_page('blood-testing')) {
wp_enqueue_script('maps-js', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBTfVURGZR7YFppqYW9LVpRCk0xmup0YSg', array('jquery'), '', true);
wp_enqueue_script('cluster-maps-js', get_template_directory_uri() . '/assets/js/markerclusterer.js', array('jquery'), '', true);
wp_enqueue_script('blood-testing-maps-js', get_template_directory_uri() . '/assets/js/bloodMapScripts.js', array('jquery'), '', true);
}
if (is_page('skype-call-test-page')) {
wp_enqueue_script('skype-js', 'http://www.skypeassets.com/i/scom/js/skype-uri.js', array('jquery'), '', true);
//wp_enqueue_script( 'skype.js', get_template_directory_uri() . '/assets/js/skype.js', array( 'jquery' ), '', true );
}
//infinite scroll
wp_enqueue_script('infinite-scroll-js', '//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js', array('jquery'), '', true);
//Masonry Grid
wp_enqueue_script('masonry-js', '//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js', array('jquery'), '', true);
//Images Loaded
wp_enqueue_script('images-loaded-js', '//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js', array('jquery'), '', true);
//jSignature.js
wp_enqueue_script('jSignature.js', get_template_directory_uri() . '/assets/js/jSignature.min.noconflict.js', array('jquery'), '', true);
if (is_page_template('template-video-chat.php') || is_singular('consult')) {
//simpleWebRTC
//wp_enqueue_script( 'simpleWebRTC.js', 'https://simplewebrtc.com/latest-v2.js', array( 'jquery' ), '', true );
//wp_enqueue_script( 'video.js', get_template_directory_uri() . '/assets/js/video-scripts.js', array( 'jquery' ), '', true );
}
//Video.js
//wp_enqueue_script( 'video.js', 'https://vjs.zencdn.net/5.5.3/video.js', array( 'jquery' ), '', true );
//iCheck.js
//wp_enqueue_script( 'iCheck.js', get_template_directory_uri() . '/assets/js/icheck.min.js', array( 'jquery' ), '', true );
//EnrollForm.js
wp_enqueue_script('enrollForm.js', get_template_directory_uri() . '/assets/js/enroll-form.js', array('jquery'), '', true);
//Stellar.js
wp_enqueue_script('stellar.js', get_template_directory_uri() . '/assets/js/jquery.stellar.js', array('jquery'), '', true);
//countTo.JS
wp_enqueue_script('countUp.js', get_template_directory_uri() . '/assets/js/jquery.countTo.js', array('jquery'), '', true);
// Adding Waypoints script file in the footer
wp_enqueue_script('waypoints', get_template_directory_uri() . '/assets/js/jquery.waypoints.js', array('jquery'), '', true);
wp_enqueue_script('waypoints-inview', get_template_directory_uri() . '/assets/js/inview.js', array('jquery'), '', true);
// Adding scripts file in the footer
wp_enqueue_script('site-js', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), '', true);
// Register main stylesheet
wp_enqueue_style('site-css', get_template_directory_uri() . '/assets/css/style.css', array(), '', 'all');
// Comment reply script for threaded comments
if (is_singular() and comments_open() and get_option('thread_comments') == 1) {
wp_enqueue_script('comment-reply');
}
}
示例4: sugarspice_content_width
/**
* Adjust $content_width it depending on the temaplte used
*/
function sugarspice_content_width()
{
global $content_width;
if (!is_active_sidebar('sidebar-1') || is_page_template('full-width-page.php')) {
$content_width = 940;
}
}
示例5: mighty_content_width
function mighty_content_width()
{
if (is_page_template('template-homepage.php') || is_page_template('template-full-width.php') || is_singular('portfolio') || is_attachment()) {
global $content_width;
$content_width = 980;
}
}
示例6: first_content_width
/**
* Adjust content_width value for full width template.
*/
function first_content_width()
{
if (is_page_template('page_fullwidth.php')) {
global $content_width;
$content_width = 1000;
}
}
示例7: planar_content_width
function planar_content_width()
{
global $content_width;
if (is_front_page() || is_page_template('page-templates/page-fullwidth.php') || is_page_template('page-templates/homepage-one.php') || is_page_template('page-templates/page-childgrid.php')) {
$content_width = 1400;
}
}
示例8: airballoon_display_custom_header
function airballoon_display_custom_header()
{
// Get Theme Options from Database
$options = get_option('zeenoble_options');
// Don't display header image on template-frontpage.php
if (is_page_template('template-frontpage.php')) {
return;
}
// Don't display header image when "display frontpage template automatically on home page" option is activated
if (is_front_page() and isset($options['themeZee_frontpage_activate']) and $options['themeZee_frontpage_activate'] == 'true') {
return;
}
// Check if page is displayed and featured header image is used
if (is_page() && has_post_thumbnail()) {
?>
<div id="custom-header">
<?php
the_post_thumbnail('frontpage_slider_image');
?>
</div>
<?php
// Check if there is a custom header image
} elseif (get_header_image()) {
?>
<div id="custom-header">
<img src="<?php
echo get_header_image();
?>
" />
</div>
<?php
}
}
示例9: ce_map_shortcode
function ce_map_shortcode($atts)
{
$address = 'New York';
if (is_page_template("page-post-ad.php") && !isset($_GET['id']) && is_user_logged_in()) {
global $user_ID;
$address = get_user_meta($user_ID, 'et_address', true);
}
$default = array('w' => '100%', 'h' => '300px', 'lat' => '', 'lng' => '', 'zoom' => 20, 'address' => $address, 'is_single' => 0);
$atts = wp_parse_args($atts, $default);
extract($atts);
$mininfy = get_theme_mod('ce_minify', 0);
// if(!$mininfy) {
wp_enqueue_script('ce-map-shorcode');
wp_localize_script('ce-map-shorcode', 'map_short_code', $atts);
// }
// if (!is_page_template('page-post-ad.php')) {
// wp_enqueue_script('gmap');
// wp_enqueue_script('marker_cluster', plugin_dir_url(__FILE__) . '/js/marker-cluster.js', array(
// 'gmap'
// ) , '1.0');
// wp_enqueue_style('map-style', plugin_dir_url(__FILE__) . '/css/map-front.css', true, CE_MAP_VER);
// }
$html = '<div id="map-shortcode" class="map-shortcode" style="width : ' . $w . '; heigth: ' . $h . '; margin-top:0px;">';
$html .= '</div>';
return $html;
}
示例10: my_class_names
function my_class_names($classes)
{
if (is_page_template('page-home.php')) {
$classes[] = 'p-index';
}
if (is_page_template('page-gridtext.php')) {
$classes[] = 'p-gridtext';
$classes[] = '_crumbs';
}
if (is_page_template('page-management.php')) {
$classes[] = 'p-management';
$classes[] = '_crumbs';
}
if (is_page_template('page-product.php')) {
$classes[] = 'p-product';
$classes[] = '_crumbs';
}
if (is_page_template('page-sport.php')) {
$classes[] = 'p-sport';
$classes[] = '_crumbs';
}
if (is_page_template('page-volunteer.php')) {
$classes[] = 'p-volunteer';
$classes[] = '_crumbs';
}
return $classes;
}
示例11: zero_scripts
function zero_scripts()
{
if (!is_admin()) {
//Call Modernizr
wp_register_script('modernizr', get_template_directory_uri() . '/js/libs/modernizr.dev.js', array(), null, false);
wp_enqueue_script('modernizr');
//Call JQuery
wp_deregister_script('jquery');
wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', '', '', true);
wp_enqueue_script('jquery');
if (is_front_page() || is_page_template('new-story-page.php')) {
wp_register_script('slider_js', get_template_directory_uri() . '/js/libs/slider.min.js', array('jquery'), null, true);
wp_enqueue_script('slider_js');
}
if (is_page(11) || is_child(11)) {
wp_register_script('gallery_js', get_template_directory_uri() . '/js/libs/gallery.js', array('jquery'), null, true);
wp_enqueue_script('gallery_js');
}
//Call Framework js file
wp_register_script('main_js', get_template_directory_uri() . '/js/build/concat.js', array('jquery'), '', true);
wp_enqueue_script('main_js');
}
// Setting the site URL as a global variable
// You can use it to access the template URL in the mainJSfile
$site_parameters = array('site_url' => get_site_url(), 'theme_directory' => get_template_directory_uri());
wp_localize_script('main_js', 'SiteParameters', $site_parameters);
}
示例12: clea_atout_c_tests_style
function clea_atout_c_tests_style()
{
global $post;
if (is_page_template('page/ac-front-page-template.php')) {
wp_enqueue_style('flexslider', get_template_directory_uri() . '/css/flexslider.css', array('25px'));
}
}
示例13: shootingstar_scripts_styles
/**
* Enqueues scripts and styles for front-end.
*
*/
function shootingstar_scripts_styles()
{
global $wp_styles, $wp_scripts;
// Adds JavaScript
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
if (get_theme_mod('shootingstar_infinite_scroll') != 'Disable') {
if (is_home() || is_archive() || is_search()) {
wp_enqueue_script('shootingstar-infinitescroll', get_template_directory_uri() . '/js/infinitescroll.min.js', array('jquery'), '2.0.2', true);
wp_enqueue_script('shootingstar-infinitescroll-settings', get_template_directory_uri() . '/js/infinitescroll-settings.js', array(), '1.0', true);
$shootingstar_site_parameters = array('theme_directory' => get_template_directory_uri(), 'message_load' => __('<p>Loading...</p>', 'shootingstar'), 'message_end' => __('<p>No further posts.</p>', 'shootingstar'));
wp_localize_script('shootingstar-infinitescroll-settings', 'SiteParameters', $shootingstar_site_parameters);
}
}
wp_enqueue_script('shootingstar-placeholders', get_template_directory_uri() . '/js/placeholders.js', array('jquery'), '2.0.8', true);
if (get_theme_mod('shootingstar_display_scroll_top') != 'Hide') {
wp_enqueue_script('shootingstar-scroll-to-top', get_template_directory_uri() . '/js/scroll-to-top.js', array('jquery'), '1.0', true);
}
if (get_theme_mod('shootingstar_fixed_menu') != 'Disable' && !is_page_template('template-landing-page.php')) {
wp_enqueue_script('shootingstar-menubox', get_template_directory_uri() . '/js/menubox.js', array(), '1.0', true);
}
wp_enqueue_script('shootingstar-selectnav', get_template_directory_uri() . '/js/selectnav.js', array(), '0.1', true);
wp_enqueue_script('shootingstar-responsive', get_template_directory_uri() . '/js/responsive.js', array(), '1.0', true);
wp_enqueue_script('shootingstar-html5-ie', get_template_directory_uri() . '/js/html5.min.js', array(), '3.7.2', false);
$wp_scripts->add_data('shootingstar-html5-ie', 'conditional', 'lt IE 9');
// Adds CSS
wp_enqueue_style('shootingstar-elegantfont', get_template_directory_uri() . '/css/elegantfont.css');
wp_enqueue_style('shootingstar-google-font-default', '//fonts.googleapis.com/css?family=PT+Sans&subset=latin,latin-ext');
if (class_exists('woocommerce')) {
wp_enqueue_style('shootingstar-woocommerce-custom', get_template_directory_uri() . '/css/woocommerce-custom.css');
}
}
示例14: set_portfolio_page_template_classes
/**
* Set portfolio page template classes
*/
public function set_portfolio_page_template_classes($classes)
{
if (is_page_template('portfolio-one-column.php') || is_page_template('portfolio-two-column.php') || is_page_template('portfolio-three-column.php') || is_page_template('portfolio-four-column.php') || is_page_template('portfolio-five-column.php') || is_page_template('portfolio-six-column.php') || is_page_template('portfolio-one-column-text.php') || is_page_template('portfolio-two-column-text.php') || is_page_template('portfolio-three-column-text.php') || is_page_template('portfolio-four-column-text.php') || is_page_template('portfolio-five-column-text.php') || is_page_template('portfolio-six-column-text.php') || is_page_template('portfolio-grid.php')) {
$classes[] = avada_get_portfolio_classes(Avada::c_pageID());
}
return $classes;
}
示例15: _base_scripts
function _base_scripts()
{
global $post;
// remove version
add_filter('script_loader_src', 'remove_src_version');
// global styles
wp_enqueue_style('bootstrap-min', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), '');
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(), '');
if (class_exists('bbPress')) {
if (is_bbpress()) {
wp_enqueue_style('bbpress-custom', get_template_directory_uri() . '/assets/css/bbpress.css', array(), '');
}
}
wp_enqueue_style('custom', get_template_directory_uri() . '/assets/css/customs.css', array(), '');
wp_enqueue_style('custom-style', get_template_directory_uri() . '/style.css', array(), '');
// global scripts
wp_enqueue_script('jquery');
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), '', true);
if (is_single() && get_post_type() == 'course_unit') {
wp_enqueue_script('froogaloop2', get_template_directory_uri() . '/assets/js/froogaloop2.min.js', array(), '', true);
}
if (is_page_template('page-templates/tpl-webinars.php')) {
wp_enqueue_style('fancybox', get_template_directory_uri() . '/assets/lib/fancybox/jquery.fancybox.css', array(), '');
wp_enqueue_script('fancybox', get_template_directory_uri() . '/assets/lib/fancybox/jquery.fancybox.pack.js', array(), '', true);
wp_enqueue_script('fancybox-media', get_template_directory_uri() . '/assets/lib/fancybox/helpers/jquery.fancybox-media.js', array(), '', true);
}
if (has_shortcode($post->post_content, 'iard_table')) {
wp_enqueue_script('angular', get_template_directory_uri() . '/assets/js/angular.min.js', array(), '', true);
wp_enqueue_script('angular-sanitize', get_template_directory_uri() . '/assets/js/angular-sanitize.js', array(), '', true);
wp_enqueue_script('table-app', get_template_directory_uri() . '/assets/js/tables.js', array(), '', true);
}
wp_enqueue_script('main', get_template_directory_uri() . '/assets/js/main.js', array(), '', true);
}