<?php
/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Byakurai
 */

defined( 'ABSPATH' ) || exit;
get_header();
$tmpcontent = false;
?>
	<main id="primary" class="site-main">
		<div id="main-child">
		<?php
		if ( is_home() && function_exists( 'byakuraitmp_print_home' ) ) {
			$tmpcontent = byakuraitmp_print_home();
		} elseif ( is_singular( 'post' ) && function_exists( 'byakuraitmp_print_single' ) ) {
			$tmpcontent = byakuraitmp_print_single();
		}

		if ( false === $tmpcontent ) {
			get_template_part( 'template-parts/content', 'index' );
		} elseif ( is_home() && function_exists( 'byakuraitmp_print_home' ) ) {
			edit_post_link( __( 'Edit template home', 'byakurai' ), '', '', $tmpcontent );
		} elseif ( is_singular( 'post' ) && function_exists( 'byakuraitmp_print_single' ) ) {
			edit_post_link( __( 'Edit template post', 'byakurai' ), '', '', $tmpcontent );
		}
		?>
		</div>
	</main><!-- #main -->
<?php
get_sidebar( '1' );
get_sidebar( '2' );
get_footer();
