本文整理汇总了PHP中is_page函数的典型用法代码示例。如果您正苦于以下问题:PHP is_page函数的具体用法?PHP is_page怎么用?PHP is_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_page函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:flasomm,项目名称:Montkailash,代码行数:35,代码来源:functions.php
示例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>';
}
开发者ID:ethicalux,项目名称:kairos_eux,代码行数:44,代码来源:wp_bootstrap_breadcrumbs.php
示例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');
}
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:60,代码来源:enqueue-scripts.php
示例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");
}
}
开发者ID:nickdotreid,项目名称:SFHIV-Wordpress-Theme,代码行数:7,代码来源:event-functions.php
示例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>';
}
}
}
开发者ID:sykot,项目名称:wp-bs,代码行数:25,代码来源:functions.php
示例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'));
}
开发者ID:johnbillion,项目名称:query-monitor,代码行数:7,代码来源:test-collector-theme.php
示例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;
}
开发者ID:livinglab,项目名称:webwork-for-wordpress,代码行数:35,代码来源:Client.php
示例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;
}
开发者ID:encse,项目名称:wildcat,代码行数:7,代码来源:functions.php
示例9: hatom_data_in_content_page
function hatom_data_in_content_page($content)
{
if (is_page()) {
$content .= get_hatom_data_page();
}
return $content;
}
开发者ID:collinbarrett,项目名称:collinmbarrett,代码行数:7,代码来源:functions.php
示例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;
}
开发者ID:codecookies,项目名称:cc-essentials,代码行数:26,代码来源:cce-loveit.php
示例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
}
}
开发者ID:russtx,项目名称:tac,代码行数:33,代码来源:template-tags.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 '';
}
开发者ID:thabofletcher,项目名称:tc-site,代码行数:37,代码来源:Utils.php
示例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
}
开发者ID:jeremylightsmith,项目名称:blog,代码行数:25,代码来源:functions.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();
}
}
开发者ID:fedeB-IT-dept,项目名称:fedeB_website,代码行数:27,代码来源:common-scripts.php
示例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');
}
}
开发者ID:jchristopher,项目名称:jbaths,代码行数:35,代码来源:functions.php
示例16: build_content
function build_content($content)
{
$return = $content;
if (is_single() && in_the_loop() || is_page() && in_the_loop()) {
global $post, $authordata, $wpautbox_lite;
$this->post = $post;
$this->authordata = $authordata;
$this->settings = $wpautbox_lite;
$this->allowed_post_types();
//initialize return element
if (isset($this->show_in[$this->post->post_type]) && 'no' != $this->show_in[$this->post->post_type]) {
switch ($this->show_in[$this->post->post_type]) {
case 'above':
$return = $this->construct_authorbox('above', $this->authordata->ID);
$return .= $content;
break;
case 'below':
$return = $content;
$return .= $this->construct_authorbox('below', $this->authordata->ID);
break;
case 'both':
$return = $this->construct_authorbox('above', $this->authordata->ID);
$return .= $content;
$return .= $this->construct_authorbox('below', $this->authordata->ID);
break;
default:
$return = $content;
break;
}
}
}
return $return;
}
开发者ID:phpbits,项目名称:wp-author-box-lite,代码行数:33,代码来源:functions.display.php
示例17: custom_body_class
function custom_body_class()
{
$options = get_desing_plus_option();
echo ' class="';
if (!is_page() && is_home()) {
echo ' index';
}
if ($options['header_layout'] == 'fixed') {
echo ' fixed_header';
}
if ($options['layout'] == 'right') {
echo ' layout1';
} elseif ($options['layout'] == 'left') {
echo ' layout2';
} else {
echo ' three_column';
}
if ($options['layout'] == 'three_column1') {
echo ' layout3';
} elseif ($options['layout'] == 'three_column2') {
echo ' layout4';
}
if (is_page_template('page-noside.php')) {
echo ' no_side';
}
echo ' custom-background"';
}
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:27,代码来源:functions.php
示例18: draw_modal
/**
*
* Return the form used within the modal for saving user info
*
* @since 1.0
*/
function draw_modal()
{
if (is_user_logged_in() && is_page('dashboard')) {
?>
<div class="modal fade modal--user-info modal--centered" id="modal--user-info" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="gridSystemModalLabel">User Information</h4>
<p>Providing this data will help us understand who is using our site!</p>
</div>
<div class="modal-body">
<?php
self::draw_form();
?>
</div>
</div>
</div>
</div>
<?php
}
}
开发者ID:bearded-avenger,项目名称:familyoutside,代码行数:31,代码来源:process.user-info.php
示例19: ninja_forms_get_form_ids_by_post_id
function ninja_forms_get_form_ids_by_post_id($post_id)
{
global $wpdb;
$form_ids = array();
if (is_page($post_id)) {
$form_results = ninja_forms_get_all_forms();
if (is_array($form_results) and !empty($form_results)) {
foreach ($form_results as $form) {
$form_data = $form['data'];
if (isset($form_data['append_page']) and !empty($form_data['append_page'])) {
if ($form_data['append_page'] == $post_id) {
$form_ids[] = $form['id'];
}
}
}
}
$form_id = get_post_meta($post_id, 'ninja_forms_form', true);
if (!empty($form_id)) {
$form_ids[] = $form_id;
}
} else {
if (is_single($post_id)) {
$form_id = get_post_meta($post_id, 'ninja_forms_form', true);
if (!empty($form_id)) {
$form_ids[] = $form_id;
}
}
}
return $form_ids;
}
开发者ID:idies,项目名称:escience-2016-wp,代码行数:30,代码来源:database.php
示例20: load_main_scripts
function load_main_scripts()
{
wp_register_script('scripts', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), filemtime(get_template_directory() . '/assets/js/scripts.js'), true);
// Loads in the footer with cache busting
wp_register_script('collapsible', get_template_directory_uri() . '/assets/js/jquery.collapsible.min.js', array('jquery'), 1.0, true);
wp_register_script('modernizer', get_template_directory_uri() . '/assets/js/modernizr-2.6.1-respond-1.1.0.min.js');
wp_register_script('magnific', get_template_directory_uri() . '/assets/js/jquery.magnific.min.js', array('jquery'));
wp_register_script('select', get_template_directory_uri() . '/assets/js/bootstrap-select.min.js', array('jquery'));
wp_register_script('dropdown', get_template_directory_uri() . '/assets/js/bootstrap-dropdown.js', array('jquery'), 1.0, true);
wp_register_script('fitvids', get_template_directory_uri() . '/assets/js/jquery.fitvids.js', array('jquery'), 1.0, true);
wp_register_script('tabaccord', get_template_directory_uri() . '/assets/js/easyResponsiveTabs.js', array('jquery'), 1.0, true);
//wp_register_script( 'placeholders', get_template_directory_uri() . '/assets/js/Placeholders.js', array( 'jquery' ), 1.0, true );
//wp_register_script( 'glossary', get_template_directory_uri() . '/assets/js/jquery.zglossary.min.js', array( 'jquery' ), 1.0, true );
wp_enqueue_script('modernizer');
wp_enqueue_script('scripts');
wp_enqueue_script('select');
wp_enqueue_script('dropdown');
wp_enqueue_script('magnific');
wp_enqueue_script('fitvids');
//wp_enqueue_script( 'placeholders' );
wp_enqueue_script('tabaccord');
if (is_page() or get_post_type() == 'state' or get_post_type() == 'faq') {
wp_enqueue_script('collapsible');
}
if (!is_front_page() or !is_post_type_archive('glossary')) {
wp_enqueue_script('glossary');
}
if (is_page_template('page-templates/template-video-gallery.php')) {
// load only on video gallery
wp_enqueue_script('lazyYT', get_template_directory_uri() . '/assets/js/lazyYT.js', array('jquery'), 1.0, true);
// lazy load youtube
}
}
开发者ID:61pixels,项目名称:incnow,代码行数:33,代码来源:functions.php
注:本文中的is_page函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论