本文整理汇总了PHP中theme::use_part方法的典型用法代码示例。如果您正苦于以下问题:PHP theme::use_part方法的具体用法?PHP theme::use_part怎么用?PHP theme::use_part使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theme
的用法示例。
在下文中一共展示了theme::use_part方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
* Display a standard page with the loop replaced by the 404 page content
*/
theme::use_part('loop', 'content', '404');
theme::part('template', 'template', 'default');
示例2:
<?php
/**
* The default page template
*
* Shows pages as the default template without any sidebars.
*
* @package Semanitic UI for WordPress
*/
theme::use_part('layout', 'layout', 'sidebar-none');
theme::part('template', 'template', 'default');
示例3:
<?php
/*
Template Name: First-Run
*/
theme::use_part('header', 'content', 'header', 'none');
theme::part('layout', 'layout', 'first-run');
示例4: array
// Theme Autoloader
require_once __DIR__ . '/includes/autoload.php';
// Alias to our custom theme class
// Alternatively, you could just extend \projectcleverweb\lastautoindex\theme
class theme extends \projectcleverweb\lastautoindex\themes\default_theme\main
{
}
// Run our custom init
theme::init();
// Register all scripts & styles (you need to queue them if you want to use them on a page)
// Styles - theme::register_style($id, $url [, $options = array('order' => 1000)])
theme::register_style('font-awesome', theme::$styles_uri . '/font-awesome.min.css', array('order' => 600));
theme::register_style('webicons', theme::$styles_uri . '/webicons.min.css', array('order' => 700));
theme::register_style('semantic', theme::$styles_uri . '/semantic-ui/semantic.min.css', array('order' => 800));
theme::register_style('highlight-js', theme::$styles_uri . '/highlight.js/github.min.css', array('order' => 900));
theme::register_style('readme', theme::$styles_uri . '/readme.css');
theme::register_style('main', theme::$styles_uri . '/main.css', array('order' => 1500));
// Scripts - theme::register_script($id, $url [, $options = array('order' => 1000)])
theme::register_script('jquery', theme::$scripts_uri . '/jquery-2.1.3.min.js', array('order' => 500));
theme::register_script('modernizr', theme::$scripts_uri . '/modernizr-2.8.3.min.js', array('order' => 600));
theme::register_script('moustrap', theme::$scripts_uri . '/mousetrap.min.js', array('order' => 700));
theme::register_script('highlight-js', theme::$scripts_uri . '/highlight.pack.min.js', array('order' => 800));
theme::register_script('semantic', theme::$scripts_uri . '/semantic.min.js', array('order' => 900));
theme::register_script('tablesort', theme::$scripts_uri . '/jquery.tablesort.min.js');
theme::register_script('main', theme::$scripts_uri . '/main.js', array('order' => 1500));
// Add special cases for when trying to login or install
if (isset($_GET['login']) && theme::$config['allow_login']) {
theme::use_part('login', 'template', 'index');
} elseif (isset($_GET['install']) && defined('LAI_INSTALLED') && LAI_INSTALLED === FALSE) {
theme::use_part('install', 'template', 'index');
}
示例5:
<?php
/**
* Woocommerce Specific Page.
*
* This page is only used by Woocommerce when it is installed as a plugin. This
* page is otherwise pointless. This page just replaces the standard loop with
* the woocommerce content.
*
* @package Semanitic UI for WordPress
*/
theme::use_part('loop', 'content', 'woocommerce');
theme::part('template', 'template', 'default');