• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_page_template函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_page_template函数的典型用法代码示例。如果您正苦于以下问题:PHP get_page_template函数的具体用法?PHP get_page_template怎么用?PHP get_page_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_page_template函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: zgm_flexible_content

function zgm_flexible_content()
{
    global $post;
    global $postid;
    global $pagetemplateclass;
    global $template;
    $postid = $post->ID;
    // get the global post and set the post id for use in get field calls and get_the_title()
    $template = explode('.', basename(get_page_template()))[0];
    // get template base name minus extension
    $pagetemplateclass = '';
    // set default for section class
    $showAlways = false;
    // set default for always show based on pre-existing setup incase felx content isnt set
    $gracefull = true;
    // check if the flexible content field has rows of data
    ob_start();
    if (have_rows('page_builder', $postid)) {
        $gracefull = false;
        // loop through the rows of data
        while (have_rows('page_builder', $postid)) {
            the_row();
            // locate and insert templates for layouts
            locate_template('templates/flexible/' . get_row_layout() . '.php', true, false);
        }
    }
    ob_end_flush();
    // end flex content
}
开发者ID:Jpwaldstein,项目名称:sage,代码行数:29,代码来源:acf.php


示例2: gllr_template_redirect

 public function gllr_template_redirect()
 {
     global $wp_query;
     $post_type = get_post_type();
     $file_exists_flag = false;
     $rb_plugin_path = ELM_RBWS_PLUGIN_PATH . '/templates';
     $rb_theme_path = STYLESHEETPATH . '/elm-templates';
     if ('gallery' == $post_type && "" == $wp_query->query_vars["s"] && !isset($wp_query->query_vars["gallery_categories"])) {
         if (file_exists($rb_theme_path . '/gallery-single-template.php')) {
             $full_path = $rb_theme_path . '/gallery-single-template.php';
         } else {
             $full_path = $rb_plugin_path . '/gallery-single-template.php';
         }
         $include_flag = true;
     } elseif ('gallery' == $post_type && isset($wp_query->query_vars["gallery_categories"]) || basename(get_page_template()) == 'gallery-template.php') {
         if (file_exists($rb_theme_path . '/gallery-template.php')) {
             $full_path = $rb_theme_path . '/gallery-template.php';
         } else {
             $full_path = $rb_plugin_path . '/gallery-template.php';
         }
         $include_flag = true;
     }
     if ($include_flag) {
         include $full_path;
         exit;
     }
 }
开发者ID:elementous,项目名称:ratings-for-bws-gallery,代码行数:27,代码来源:ratings_for_bws_gallery.class.php


示例3: incir_body_class

function incir_body_class()
{
    $classes = get_body_class();
    if (is_front_page()) {
        $template = basename(get_page_template());
        switch ($template) {
            case 'page-front-1.php':
                $classes[] = 'home-1';
                break;
            case 'page-front-2.php':
                $classes[] = 'home-2';
                break;
            case 'page-front-3.php':
                $classes[] = 'home-3';
                break;
            case 'page.php':
                $classes[] = 'home-1';
                break;
            case 'index.php':
                $classes[] = 'home-1';
                break;
        }
    }
    $classes = implode(' ', $classes);
    return $classes;
}
开发者ID:enesgur,项目名称:incir-wp,代码行数:26,代码来源:functions.php


示例4: evision_corporate_front_page

 /**
  * Before main content
  *
  * @since eVision Corporate 1.0.0
  *
  * @param null
  * @return null
  *
  */
 function evision_corporate_front_page()
 {
     if ('posts' == get_option('show_on_front')) {
         include get_home_template();
     } elseif (1 != evision_corporate_if_all_disable()) {
         include get_page_template();
     } else {
         /*home banner section*/
         do_action('evision_corporate_action_front_slider');
         /*about section*/
         do_action('evision_corporate_action_front_about');
         /*service section*/
         do_action('evision_corporate_action_front_service');
         /*portfolio section*/
         do_action('evision_corporate_action_front_portfolio');
         /*client section*/
         do_action('evision_corporate_action_front_client');
         /*testimonial section*/
         do_action('evision_corporate_action_front_testimonial');
         /*blog section*/
         do_action('evision_corporate_action_front_blog');
         /*team section*/
         do_action('evision_corporate_action_front_team');
         /*map section*/
         do_action('evision_corporate_action_front_map');
         /*contact section*/
         do_action('evision_corporate_action_front_contact');
     }
 }
开发者ID:karthikakamalanathan,项目名称:wp-cookieLawInfo,代码行数:38,代码来源:front-page.php


示例5: __construct

 public function __construct($filename = null)
 {
     $this->template_file = $filename;
     $this->layout = new \Dovetail\Core\Layout();
     if (is_Admin()) {
         /**
          * If we are actually editing the page this template belongs to. 
          */
         if ($this->template_file !== null && get_page_template($this->template_file) == get_page_template()) {
             // Remove Editor
             add_action('admin_init', array($this, 'remove_editor'));
             // Add Layout builder
             add_action('edit_form_after_title', array($this, 'layout_builder'));
             // Layout builder enquue
             add_action('admin_enqueue_scripts', array($this, 'layout_scripts'));
             add_action('admin_print_scripts', array($this, 'layout_print_scripts'));
         }
     } else {
         // Filters
         add_filter('wp_title', array($this, 'wp_title'), 10, 2);
         // Add a more descriptive title
         // Render this page
         $this->render();
     }
 }
开发者ID:adm351,项目名称:dovetail,代码行数:25,代码来源:Template.php


示例6: getWpTemplate

function getWpTemplate()
{
    if (defined('WP_USE_THEMES') && WP_USE_THEMES) {
        $template = false;
        if (is_404() && ($template = get_404_template())) {
        } elseif (is_search() && ($template = get_search_template())) {
        } elseif (is_tax() && ($template = get_taxonomy_template())) {
        } elseif (is_front_page() && ($template = get_front_page_template())) {
        } elseif (is_home() && ($template = get_home_template())) {
        } elseif (is_attachment() && ($template = get_attachment_template())) {
        } elseif (is_single() && ($template = get_single_template())) {
        } elseif (is_page() && ($template = get_page_template())) {
        } elseif (is_category() && ($template = get_category_template())) {
        } elseif (is_tag() && ($template = get_tag_template())) {
        } elseif (is_author() && ($template = get_author_template())) {
        } elseif (is_date() && ($template = get_date_template())) {
        } elseif (is_archive() && ($template = get_archive_template())) {
        } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
        } elseif (is_paged() && ($template = get_paged_template())) {
        } else {
            $template = get_index_template();
        }
        return str_replace(ABSPATH, '', $template);
    } else {
        return null;
    }
}
开发者ID:jtomeck,项目名称:jtwebfolio,代码行数:27,代码来源:showThemeFile.php


示例7: is_ddlayout_template

/**
 * @return bool
 * to be used in template files or with template redirect hook to check whether current page has a layout template
 */
function is_ddlayout_template()
{
    global $wpddlayout;
    $temp = get_page_template();
    $pos = strrpos($temp, '/');
    $template = substr($temp, $pos + 1);
    return in_array($template, $wpddlayout->templates_have_layout(array($template => 'name')));
}
开发者ID:javierdlahoz,项目名称:paella-development,代码行数:12,代码来源:ddl-theme-api.php


示例8: actAdminPrintScripts

 public function actAdminPrintScripts()
 {
     $currentScreen = $this->_getWPLayer()->get_current_screen();
     $currentScreenId = $currentScreen->id;
     if (strpos($currentScreenId, 'ff-layout') !== false || strpos(get_page_template(), 'page-onepage') !== false || $currentScreenId == 'page') {
         $this->_unregisterEmoji();
     }
 }
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:8,代码来源:class.ffLayoutsEmojiManager.php


示例9: wildcat_show404

function wildcat_show404($template)
{
    global $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query();
    $wp_query->query('pagename=error');
    $wp_query->the_post();
    $template404 = get_page_template();
    rewind_posts();
    return $template404;
}
开发者ID:encse,项目名称:wildcat,代码行数:11,代码来源:functions.php


示例10: my_page_template_redirect

function my_page_template_redirect()
{
    global $post;
    $arrayUrl = array('cacao-fino-de-aroma-en' => 'page-cacao-fino-de-aroma', 'cacao-fino-de-aroma-fr' => 'page-cacao-fino-de-aroma', 'cacao-fino-de-aroma-de' => 'page-cacao-fino-de-aroma', 'cacao-fino-de-aroma-sk' => 'page-cacao-fino-de-aroma', 'cacao-fino-de-aroma-it' => 'page-cacao-fino-de-aroma', 'cacao-fino-de-aroma-ru' => 'page-cacao-fino-de-aroma', 'product' => 'page-productos', 'produits' => 'page-productos', 'produkte' => 'page-productos', 'produkty' => 'page-productos', 'prodotto' => 'page-productos', 'products' => 'page-productos', 'tailor-made-innovation' => 'page-a-su-medida', 'linnovation-sur-mesure' => 'page-a-su-medida', 'kundenwunsch' => 'page-a-su-medida', 'vylepsenia-na-mieru' => 'page-a-su-medida', 'innovazione-su-misura' => 'page-a-su-medida', 'tailor-made-innovation-ru' => 'page-a-su-medida', 'the-luker-way-es' => 'page-the-luker-way', 'the-luker-way-fr' => 'page-the-luker-way', 'the-luker-way-de' => 'page-the-luker-way', 'the-luker-way-sk' => 'page-the-luker-way', 'the-luker-way-it' => 'page-the-luker-way', 'the-luker-way-ru' => 'page-the-luker-way', 'granja-luker-es' => 'page-granja-luker', 'granja-luker-fr' => 'page-granja-luker', 'granja-luker-de' => 'page-granja-luker', 'granja-luker-sk' => 'page-granja-luker', 'granja-luker-it' => 'page-granja-luker', 'granja-luker-ru' => 'page-granja-luker', 'contact' => 'page-contactenos', 'contactez-nous' => 'page-contactenos', 'kontakt' => 'page-contactenos', 'kontakty' => 'page-contactenos', 'contatti' => 'page-contactenos', 'contact-ru' => 'page-contactenos', 'news' => 'page-noticias', 'nouvelles' => 'page-noticias', 'aktuell' => 'page-noticias', 'novinky' => 'page-noticias', 'notizie' => 'page-noticias', 'news-ru' => 'page-noticias', 'recipes' => 'page-recetas', 'recettes' => 'page-recetas', 'rezepte' => 'page-recetas', 'recepty' => 'page-recetas', 'ricette' => 'page-recetas', 'recipes-ru' => 'page-recetas', 'thanks' => 'page-gracias', 'gracias' => 'page-gracias', 'ace' => 'page-gracias', 'dank' => 'page-gracias', 'hvala' => 'page-gracias', 'grazie' => 'page-gracias', 'thanks-ru' => 'page-gracias');
    if (array_key_exists(get_post($post)->post_name, $arrayUrl)) {
        if (!get_page_template() && !is_home()) {
            get_template_part($arrayUrl[get_post($post)->post_name]);
            exit;
        }
    }
}
开发者ID:juan2ramos,项目名称:casaLuker,代码行数:11,代码来源:functions.php


示例11: page_builder_button

    /**
     * Page Builder Button
     */
    public function page_builder_button()
    {
        global $post;
        // This button is only used for pages
        if (!in_array($post->post_type, array('page'))) {
            return;
        }
        // Check if we're using the builder for this page
        $is_builder_used = 'builder.php' == basename(get_page_template()) ? true : false;
        printf('<div id="layers_toggle_builder" class=" %3$s">
					<div  class="postbox layers-push-top">
						<div class="layers-section-title layers-no-push-bottom layers-content-large">
							<div class="layers-heading">
								%1$s
							</div>
							<p class="layers-excerpt">
								%5$s
							</p>
						</div>
						<div class="layers-button-well clearfix">
							<a href="%2$s" class="layers-button btn-massive btn-primary btn-full" id="%4$s">%6$s</a>
						</div>
					</div>

					<div class="layers-row">

						<div class="layers-column layers-span-4 postbox layers-content">
							<div class="layers-section-title layers-tiny">
								<h4 class="layers-heading">Export Layout</h4>
								<p class="layers-excerpt">Export your layout to a <code>.json</code> file which you can use to upload to another site.</p>
							</div>
							<a href="?post=%8$s&amp;action=edit&amp;layers-export=1" class="layers-button">Export</a>
						</div>

						<div class="layers-column layers-span-4 postbox layers-content">
							<div class="layers-section-title layers-tiny">
								<h4 class="layers-heading">Import Layout</h4>
								<p class="layers-excerpt"> Upload a layout file (eg. <code>%9$s.json</code>) by clicking the button below.</p>
							</div>
							<button class="layers-button" id="layers-page-import-button" data-post-id="%8$s" data-title="Upload .json" data-button_text="Upload &amp; Import">Upload &amp; Import</button>
						</div>

						<div class="layers-column layers-span-4 postbox layers-content">
							<div class="layers-section-title layers-tiny">
								<h4 class="layers-heading">Duplicate Layout</h4>
								<p class="layers-excerpt">Easily duplicate your layout, settings, text and images in order to get started quickly with a new page.</p>
							</div>
							<button href="" class="layers-button" id="layers-page-duplicate-button" data-post-id="%8$s">Duplicate</button>
						</div>

					</div>
				</div>', 'Your page is ready.', admin_url() . 'customize.php?url=' . esc_url(get_the_permalink()), true == $is_builder_used ? '' : 'layers-hide', isset($post->ID) ? 'builder-button-' . $post->ID : 'builder-button-' . rand(0, 1), __('You can drag and drop widgets, edit content and tweak the design. Click the button below to see your page come to life.', 'layerswp'), __('Edit Your Page', 'layerswp'), get_template_directory_uri(), get_the_ID(), $post->post_name);
    }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:56,代码来源:init.php


示例12: set_template_as_first_option

 /**
  * Prepend {page_template} on the view stack for custom page
  *
  * @param array $options Current options.
  *
  * @return mixed
  */
 public function set_template_as_first_option($options)
 {
     $page_template = get_page_template();
     if ($page_template) {
         $page_template_base = basename($page_template);
         $page_template_pure = str_replace('.php', '', $page_template_base);
         // Reversed order; first look for 'custom', then 'single'.
         array_unshift($options, 'single/' . $page_template_pure);
         array_unshift($options, 'custom/' . $page_template_pure);
     }
     return $options;
 }
开发者ID:moorscode,项目名称:stencil,代码行数:19,代码来源:custom.php


示例13: load_template

 /**
  * Copy-pasta of wp-includes/template-loader.php
  */
 private function load_template()
 {
     do_action('template_redirect');
     $template = false;
     if (is_404() && ($template = get_404_template())) {
     } elseif (is_search() && ($template = get_search_template())) {
     } elseif (is_front_page() && ($template = get_front_page_template())) {
     } elseif (is_home() && ($template = get_home_template())) {
     } elseif (is_post_type_archive() && ($template = get_post_type_archive_template())) {
     } elseif (is_tax() && ($template = get_taxonomy_template())) {
     } elseif (is_attachment() && ($template = get_attachment_template())) {
         remove_filter('the_content', 'prepend_attachment');
     } elseif (is_single() && ($template = get_single_template())) {
     } elseif (is_page() && ($template = get_page_template())) {
     } elseif (is_category() && ($template = get_category_template())) {
     } elseif (is_tag() && ($template = get_tag_template())) {
     } elseif (is_author() && ($template = get_author_template())) {
     } elseif (is_date() && ($template = get_date_template())) {
     } elseif (is_archive() && ($template = get_archive_template())) {
     } elseif (is_comments_popup() && ($template = get_comments_popup_template())) {
     } elseif (is_paged() && ($template = get_paged_template())) {
     } else {
         $template = get_index_template();
     }
     /**
      * Filter the path of the current template before including it.
      *
      * @since 3.0.0
      *
      * @param string $template The path of the template to include.
      */
     if ($template = apply_filters('template_include', $template)) {
         $template_contents = file_get_contents($template);
         $included_header = $included_footer = false;
         if (false !== stripos($template_contents, 'get_header();')) {
             do_action('get_header', null);
             locate_template('header.php', true, false);
             $included_header = true;
         }
         include $template;
         if (false !== stripos($template_contents, 'get_footer();')) {
             do_action('get_footer', null);
             locate_template('footer.php', true, false);
             $included_footer = true;
         }
         if ($included_header && $included_footer) {
             global $wp_scripts;
             $wp_scripts->done = array();
         }
     }
     return;
 }
开发者ID:danielbachhuber,项目名称:unholy,代码行数:55,代码来源:class-unholy-testcase.php


示例14: cmb_exclude_section_child_page

/**
 * Exclude setting on section child page
 * @param  object $field Current field object
 * @return bool
 * @author Jordan Pakrosnis
 */
function cmb_exclude_section_child_page($field)
{
    // Get Current Template
    $current_template = basename(get_page_template());
    // If it's a section page or section grid, check if it's a child
    // Exclude on these templates
    if ($current_template == 'page_section.php' || $current_template == 'page_section_grid.php') {
        $page_parents = get_post_ancestors($post);
        if ($page_parents[0] != '') {
            return 0;
        }
    }
    // if()
    return 1;
}
开发者ID:JordanPak,项目名称:UCFBands,代码行数:21,代码来源:show-on-cb.php


示例15: nucleus_body_classes

/**
 * Add and remove body classes
 */
function nucleus_body_classes($classes)
{
    // Add post/page slug if not present and template slug
    if (is_single() || is_page() && !is_front_page()) {
        if (!in_array(basename(get_permalink()), $classes)) {
            $classes[] = basename(get_permalink());
        }
        $classes[] = str_replace('.php', '', basename(get_page_template()));
    }
    // Remove unnecessary classes
    $home_id_class = 'page-id-' . get_option('page_on_front');
    $remove_classes = array('page-template-default', $home_id_class);
    $classes = array_diff($classes, $remove_classes);
    return $classes;
}
开发者ID:rgfx,项目名称:Nucleus,代码行数:18,代码来源:cleanup.php


示例16: show404

 function show404($template)
 {
     global $wp_query;
     $template404 = $template;
     $pageid = $this->settings['404page_page_id'];
     if ($pageid > 0) {
         $wp_query = null;
         $wp_query = new WP_Query();
         $wp_query->query('page_id=' . $pageid);
         $wp_query->the_post();
         $template404 = get_page_template();
         rewind_posts();
     }
     return $template404;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:15,代码来源:404page.php


示例17: execute

 /**
  * Exection hook
  *
  * @param Stencil_Interface $controller Controller that initiated this class.
  */
 public function execute(Stencil_Interface $controller)
 {
     $post_type = get_post_type();
     Stencil_Environment::trigger('single', $controller);
     Stencil_Environment::trigger($post_type, $controller);
     Stencil_Environment::trigger(get_the_ID(), $controller);
     $page_template = get_page_template();
     if ($page_template) {
         // Always include template file.
         include $page_template;
         $page_template_base = basename($page_template);
         Stencil_File_System::load($page_template_base);
         Stencil_Environment::trigger(rtrim($page_template_base, '.php'), $controller);
         Stencil_Environment::trigger($page_template_base, $controller);
     }
 }
开发者ID:moorscode,项目名称:stencil,代码行数:21,代码来源:page.php


示例18: use_plugin_on_current_page

 function use_plugin_on_current_page()
 {
     if ($this->use_on_current_page === null) {
         if (in_array(basename(get_page_template()), apply_filters('acfpbf_use_on_templates', array()))) {
             $use_on_current_page = true;
         } else {
             $panels_data = get_post_meta(get_the_ID(), 'panels_data', true);
             if (isset($panels_data) && !empty($panels_data)) {
                 $use_on_current_page = false;
             } else {
                 $use_on_current_page = true;
             }
         }
         $this->use_on_current_page = apply_filters('acfpbf_use_on_current_page', $use_on_current_page);
     }
     return $this->use_on_current_page;
 }
开发者ID:moelleer,项目名称:ACF-Page-Builder-Field,代码行数:17,代码来源:acf-page_builder_field.php


示例19: supermag_front_page

 function supermag_front_page()
 {
     if ('posts' == get_option('show_on_front')) {
         include get_home_template();
     } elseif (is_active_sidebar('supermag-home')) {
         ?>
         <div id="primary" class="content-area">
             <main id="main" class="site-main" role="main">
                 <?php 
         dynamic_sidebar('supermag-home');
         ?>
             </main>
             <!-- #main -->
         </div><!-- #primary -->
         <?php 
     } else {
         include get_page_template();
     }
 }
开发者ID:idea-lab,项目名称:Spectrum,代码行数:19,代码来源:front-page.php


示例20: biography_front_page

 /**
  * Before main content
  *
  * @since biography 1.0.0
  *
  * @param null
  * @return null
  *
  */
 function biography_front_page()
 {
     if ('posts' == get_option('show_on_front')) {
         include get_home_template();
     } elseif (1 == biography_if_all_disable()) {
         /**
          * homepage hook
          * @since Biography 1.0.0
          *
          * @hooked biography_home_service -  10
          * @hooked biography_home_review -  20
          * @subhooked biography_home_testimonial 10
          * @hooked biography_home_history -  30
          */
         do_action('homepage');
     } else {
         include get_page_template();
     }
 }
开发者ID:xhasur,项目名称:wordPro,代码行数:28,代码来源:front-page.php



注:本文中的get_page_template函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_page_template_slug函数代码示例发布时间:2022-05-15
下一篇:
PHP get_page_statuses函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap