Remove template_part, template_sidebar, temp sidebar fix
This commit is contained in:
@@ -15,24 +15,6 @@ function template_unwrap($slug = '', $context = []) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $context
|
||||
*/
|
||||
function template_sidebar($context = []) {
|
||||
template_part('sidebar', $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $template
|
||||
* @param array $context
|
||||
*/
|
||||
function template_part($template, $context = []) {
|
||||
if ($file = (new Template($template, $context))->locate()) {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
include $file;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $filename
|
||||
* @return string
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php App\template_part('partials/page-header'); ?>
|
||||
<?php get_template_part('partials/page-header'); ?>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
<?php _e('Sorry, but the page you were trying to view does not exist.', 'sage'); ?>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php App\template_part('partials/page-header'); ?>
|
||||
<?php get_template_part('partials/page-header'); ?>
|
||||
|
||||
<?php if (!have_posts()) : ?>
|
||||
<div class="alert alert-warning">
|
||||
@@ -8,7 +8,7 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<?php App\template_part('partials/content-' . (get_post_type() != 'post' ? get_post_type() : get_post_format())); ?>
|
||||
<?php get_template_part('partials/content', get_post_type() != 'post' ? get_post_type() : get_post_format()); ?>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php the_posts_navigation(); ?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!doctype html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<?php App\template_part('partials/head'); ?>
|
||||
<?php get_template_part('partials/head'); ?>
|
||||
<body <?php body_class(); ?>>
|
||||
<!--[if IE]>
|
||||
<div class="alert alert-warning">
|
||||
@@ -9,7 +9,7 @@
|
||||
<![endif]-->
|
||||
<?php
|
||||
do_action('get_header');
|
||||
App\template_part('partials/header');
|
||||
get_template_part('partials/header');
|
||||
?>
|
||||
<div class="wrap container" role="document">
|
||||
<div class="content row">
|
||||
@@ -18,14 +18,14 @@
|
||||
</main><!-- /.main -->
|
||||
<?php if (App\display_sidebar()) : ?>
|
||||
<aside class="sidebar">
|
||||
<?php App\template_sidebar(); ?>
|
||||
<?php get_template_part('partials/sidebar'); ?>
|
||||
</aside><!-- /.sidebar -->
|
||||
<?php endif; ?>
|
||||
</div><!-- /.content -->
|
||||
</div><!-- /.wrap -->
|
||||
<?php
|
||||
do_action('get_footer');
|
||||
App\template_part('partials/footer');
|
||||
get_template_part('partials/footer');
|
||||
wp_footer();
|
||||
?>
|
||||
</body>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<?php App\template_part('partials/page-header'); ?>
|
||||
<?php App\template_part('partials/content-page'); ?>
|
||||
<?php get_template_part('partials/page-header'); ?>
|
||||
<?php get_template_part('partials/content-page'); ?>
|
||||
<?php endwhile; ?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<article <?php post_class(); ?>>
|
||||
<header>
|
||||
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
||||
<?php if (get_post_type() === 'post') { App\template_part('partials/entry-meta'); } ?>
|
||||
<?php if (get_post_type() === 'post') { get_template_part('partials/entry-meta'); } ?>
|
||||
</header>
|
||||
<div class="entry-summary">
|
||||
<?php the_excerpt(); ?>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<article <?php post_class(); ?>>
|
||||
<header>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
<?php App\template_part('partials/entry-meta'); ?>
|
||||
<?php get_template_part('partials/entry-meta'); ?>
|
||||
</header>
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<article <?php post_class(); ?>>
|
||||
<header>
|
||||
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
||||
<?php App\template_part('partials/entry-meta'); ?>
|
||||
<?php get_template_part('partials/entry-meta'); ?>
|
||||
</header>
|
||||
<div class="entry-summary">
|
||||
<?php the_excerpt(); ?>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php App\template_part('partials/header-page'); ?>
|
||||
<?php get_template_part('partials/header-page'); ?>
|
||||
|
||||
<?php if (!have_posts()) : ?>
|
||||
<div class="alert alert-warning">
|
||||
@@ -8,7 +8,7 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<?php App\template_part('partials/content-search'); ?>
|
||||
<?php get_template_part('partials/content-search'); ?>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php the_posts_navigation(); ?>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<?php App\template_part('partials/content-single-' . get_post_type()); ?>
|
||||
<?php get_template_part('partials/content-single-' . get_post_type()); ?>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
?>
|
||||
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<?php App\template_part('partials/page-header'); ?>
|
||||
<?php App\template_part('partials/content-page'); ?>
|
||||
<?php get_template_part('partials/page-header'); ?>
|
||||
<?php get_template_part('partials/content-page'); ?>
|
||||
<?php endwhile; ?>
|
||||
|
||||
Reference in New Issue
Block a user