本文整理匯總了PHP中is_page函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_page函數的具體用法?PHP is_page怎麽用?PHP is_page使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_page函數的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: 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>';
}
示例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: sfhiv_add_event_filter
function sfhiv_add_event_filter()
{
$archive_type = mini_archive_on_page(get_the_ID());
if (is_page() && $archive_type && $archive_type == 'event') {
get_template_part("nav", "event");
}
}
示例5: MyBreadcrumb
function MyBreadcrumb()
{
if (!is_home()) {
echo '<li><a href="';
echo get_option('home');
echo '/">';
echo 'Home';
echo '</a><span class="divider">/</span></li>';
if (is_category() || is_single()) {
echo '<li>';
the_category(', ', '&title_li=');
echo '<span class="divider">/</span></li>';
echo '</li>';
if (is_single()) {
echo '<li class="active">';
// the_title();
echo '</li>';
}
} elseif (is_page()) {
echo '<li class="active">';
the_title();
echo '</li>';
}
}
}
示例6: testThemeTemplateIsCorrectForPage
public function testThemeTemplateIsCorrectForPage()
{
$page = $this->factory->post->create(array('post_type' => 'page'));
$this->go_to_with_template(get_permalink($page));
$this->assertTrue(is_page());
$this->assertSame('page.php', self::get_theme_data('template_file'));
}
示例7: filter_the_content
public function filter_the_content($content)
{
$ww_problem = false;
if (is_page('webwork')) {
$ww_problem = true;
} else {
$ww_problem = get_query_var('ww_problem');
}
if ($ww_problem) {
$content = '<div id="webwork-app"></div>';
wp_enqueue_script('webwork-app', plugins_url() . '/webwork/build/index.js');
$route_base = get_option('home');
$route_base = preg_replace('|https?://[^/]+/|', '', $route_base);
// @todo Centralize this logic.
$main_site_url = get_blog_option(1, 'home');
$rest_api_endpoint = trailingslashit($main_site_url) . 'wp-json/webwork/v1/';
// @todo Abstract.
$post_data = null;
$ww_problem_text = '';
if (!empty($_GET['post_data_key'])) {
$post_data = get_blog_option(1, $_GET['post_data_key']);
$ww_problem_text = base64_decode($post_data['pg_object']);
}
// @todo This is awful.
$clients = get_blog_option(1, 'webwork_clients');
$remote_course_url = array_search(get_current_blog_id(), $clients);
wp_localize_script('webwork-app', 'WWData', array('problem_id' => $ww_problem, 'problem_text' => $ww_problem_text, 'remote_course_url' => $remote_course_url, 'rest_api_nonce' => wp_create_nonce('wp_rest'), 'rest_api_endpoint' => $rest_api_endpoint, 'route_base' => trailingslashit($route_base) . 'webwork/', 'user_can_ask_question' => is_user_logged_in(), 'user_can_post_response' => is_user_logged_in(), 'user_can_vote' => is_user_logged_in()));
wp_enqueue_style('webwork-app', plugins_url() . '/webwork/assets/css/app.css');
wp_register_script('webwork-mathjax-loader', WEBWORK_PLUGIN_URL . '/assets/js/webwork-mathjax-loader.js');
$webwork_mathjax_loader_strings = array('mathjax_src' => esc_url('https://cdn.mathjax.org/mathjax/latest/unpacked/MathJax.js?config=TeX-MML-AM_HTMLorMML-full'));
wp_localize_script('webwork-mathjax-loader', 'WeBWorK_MathJax', $webwork_mathjax_loader_strings);
wp_enqueue_script('webwork-mathjax-loader');
}
return $content;
}
示例8: add_custom_class
function add_custom_class($classes = array(), $menu_item = false)
{
if (!is_page() && 'Trükkök' == $menu_item->title && !in_array('current-menu-item', $classes)) {
$classes[] = 'current-menu-item';
}
return $classes;
}
示例9: hatom_data_in_content_page
function hatom_data_in_content_page($content)
{
if (is_page()) {
$content .= get_hatom_data_page();
}
return $content;
}
示例10: the_content
function the_content($content)
{
// Don't show on custom page templates
if (is_page_template()) {
return $content;
}
// Don't show on Stacked slides
if (get_post_type() == 'slide') {
return $content;
}
global $wp_current_filter;
if (in_array('get_the_excerpt', (array) $wp_current_filter)) {
return $content;
}
$cce_options = get_option('cce_options');
$show_on_posts = isset($cce_options['show_loveit_button_on']['post']) ? $cce_options['show_loveit_button_on']['post'] : FALSE;
$show_on_pages = isset($cce_options['show_loveit_button_on']['page']) ? $cce_options['show_loveit_button_on']['page'] : FALSE;
if (is_singular('post') && $show_on_posts) {
$content .= $this->do_likes('loveit-after-content');
}
if (is_page() && !is_front_page() && $show_on_pages) {
$content .= $this->do_likes('loveit-after-content');
}
//Under consideration: if(( is_front_page() || is_home() || is_category() || is_tag() || is_author() || is_date() || is_search()) && $options['add_to_other'] ) $content .= $this->do_likes();
return $content;
}
示例11: 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
}
}
示例12: getWordPressPageType
/**
* Gets the page type from WordPress.
*
* @return string A string representation of the current page type,
* corresponding to the values used by publisherplugin.google.com.
*/
public static function getWordPressPageType()
{
// is_front_page() returns true if (1) a static front page is set and this
// is that page, or (2) the front page is the blog home page and this
// is the blog home page.
if (is_front_page()) {
return 'front';
}
if (is_home()) {
return 'home';
}
if (is_single()) {
return 'singlePost';
}
if (is_page()) {
return 'page';
}
if (is_category()) {
return 'category';
}
if (is_archive()) {
return 'archive';
}
if (is_search()) {
return 'search';
}
if (is_404()) {
return 'errorPage';
}
return '';
}
示例13: widget_andreas01_pagenav
function widget_andreas01_pagenav()
{
?>
<h2 class="hide">Site menu:</h2>
<ul class="page">
<?php
if (is_page()) {
$highlight = "page_item";
} else {
$highlight = "page_item current_page_item";
}
?>
<li class="<?php
echo $highlight;
?>
"><a href="<?php
bloginfo('url');
?>
">Home</a></li>
<?php
wp_list_pages('sort_column=menu_order&depth=1&title_li=');
?>
</ul>
<?php
}
示例14: tie_register
function tie_register()
{
## Register Main style.css file
wp_register_style('tie-style', get_stylesheet_uri(), array(), '', 'all');
wp_enqueue_style('tie-style');
## Register All Scripts
wp_register_script('tie-scripts', get_template_directory_uri() . '/js/tie-scripts.js', array('jquery'), false, true);
wp_register_script('tie-tabs', get_template_directory_uri() . '/js/tabs.min.js', array('jquery'), false, true);
wp_register_script('tie-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.js', array('jquery'), false, true);
wp_register_script('tie-validation', get_template_directory_uri() . '/js/validation.js', array('jquery'), false, true);
wp_register_script('tie-flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'), false, true);
## Get Global Scripts
wp_enqueue_script('tie-scripts');
## Register WooCommerce css file
wp_register_style('tie-woocommerce', get_template_directory_uri() . '/css/woocommerce.css', array(), '', 'all');
if (class_exists('Woocommerce')) {
wp_enqueue_style('tie-woocommerce');
}
## Get Validation Script
if (tie_get_option('comment_validation') && (is_page() || is_single()) && comments_open()) {
wp_enqueue_script('tie-validation');
}
## For facebook & Google + share
if (is_singular() && tie_get_option('post_og_cards') && (!function_exists('bp_current_component') || function_exists('bp_current_component') && !bp_current_component())) {
tie_og_data();
}
}
示例15: jbaths_scripts
/**
* Enqueue scripts and styles.
*/
function jbaths_scripts()
{
$theme = wp_get_theme();
// wtf
wp_enqueue_style('wtf-forms', get_template_directory_uri() . '/css/wtf-forms.css', array(), '2.2.0');
// and then
wp_enqueue_style('jbaths', get_stylesheet_uri(), array(), $theme->Version . '.1');
// store locator plus - specialty css
if (is_page('find-a-showroom')) {
wp_enqueue_style('jbaths-slp', get_template_directory_uri() . '/css/slp-baths.css', array(), $theme->Version);
// store locator plus
}
if (!is_admin()) {
wp_register_script('jbaths.modernizr', get_stylesheet_directory_uri() . '/js/modernizr.min.js', array(), '2.8.3', true);
wp_register_script('jquery.cookie', get_stylesheet_directory_uri() . '/js/jquery.cookie.js', array('jquery'), $theme->Version);
wp_register_script('scrollupforwhat', get_stylesheet_directory_uri() . '/js/jquery.scrollupforwhat.min.js', array('jquery'), '1.2', true);
wp_register_script('matchHeight', get_template_directory_uri() . '/js/jquery.matchHeight.js', array('jquery'), '0.5.2', true);
$jbaths_deps = array('jquery', 'jbaths.modernizr', 'jquery.cookie', 'scrollupforwhat', 'matchHeight');
if (is_singular('bathtubs') || is_singular('faucets')) {
if (get_option('ultimate_row') == "enable") {
//$jbaths_deps[] = 'ultimate-row-bg';
}
}
wp_enqueue_script('jbaths', get_template_directory_uri() . '/js/baths.js', $jbaths_deps, '20140718', true);
}
wp_enqueue_script('skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);
// Omniture SiteCatalyst
wp_enqueue_script('sitecatalyst', get_template_directory_uri() . '/js/s_code.js', array(), $theme->Version, true);
if (is_singular('post') && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}