| Server IP : 14.225.204.176 / Your IP : 216.73.216.252 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/langngon.com/wp-content/themes/langngon/lib/ |
Upload File : |
<?php
/**
* Theme wrapper
*
* @link http://roots.io/an-introduction-to-the-roots-theme-wrapper/
* @link http://scribu.net/wordpress/theme-wrappers.html
*/
function roots_template_path() {
return Roots_Wrapping::$main_template;
}
function roots_sidebar_path() {
return new Roots_Wrapping('templates/sidebar.php');
}
function roots_sidebar_right_path() {
return new Roots_Wrapping('templates/sidebar-right.php');
}
class Roots_Wrapping {
// Stores the full path to the main template file
static $main_template;
// Stores the base name of the template file; e.g. 'page' for 'page.php' etc.
static $base;
public function __construct($template = 'base.php') {
$this->slug = basename($template, '.php');
$this->templates = array($template);
if (self::$base) {
$str = substr($template, 0, -4);
array_unshift($this->templates, sprintf($str . '-%s.php', self::$base));
}
}
public function __toString() {
$this->templates = apply_filters('roots/wrap_' . $this->slug, $this->templates);
return locate_template($this->templates);
}
static function wrap($main) {
self::$main_template = $main;
self::$base = basename(self::$main_template, '.php');
if (self::$base === 'index') {
self::$base = false;
}
return new Roots_Wrapping();
}
}
add_filter('template_include', array('Roots_Wrapping', 'wrap'), 99);