<?php

/**
 * Chooses the template to display
 * 
 * On used when the page doesn't have its "page template" option set.
 */
if (is_404()) {
    // There was an error with the request, display the 404 page.
    template_use_part($theme->template_sub_path . '/default', $theme->template_sub_path . '/default-page');
    template_use_part($theme->content_sub_path . '/loop', $theme->content_sub_path . '/404');
} elseif (is_front_page() || is_home()) {
    // This the home page, which is typically designed differently from the rest of the site
    template_use_part($theme->template_sub_path . '/default', $theme->template_sub_path . '/home');
}
template_part($theme->template_sub_path . '/default', $theme->post_type);
<?php

/*
Template Name: First-Run
*/
template_use_part($theme->content_sub_path . '/modals', $theme->content_sub_path . '/empty');
theme_header('none');
?>
<main>
	<div class="empty size-10">&nbsp;</div>
	<img src="<?php 
echo esc_url($theme->uri . '/logo.png');
?>
" class="ui centered image">
	<h1 class="ui center aligned dividing header">
		Welcome to Semantic UI for WordPress!
		<?php 
if (current_user_can('edit_theme_options')) {
    ?>
			<div class="sub header">This is the first-run page, you can disable it from the <a href="<?php 
    echo $theme->options_uri();
    ?>
">Theme Options</a> page.</div>
			<?php 
} else {
    ?>
			<div class="sub header">This is the first-run page, <strong>once you login</strong>, you can disable it from the Theme Options page.</div>
			<?php 
}
?>
	</h1>
<?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.
 */
template_use_part($theme->content_sub_path . '/loop', $theme->content_sub_path . '/woocommerce');
template_part($theme->template_sub_path . '/default');
 /**
  * Sets class vars and calls various setup functions
  */
 public function __construct()
 {
     // Setup debug before everything else
     new debug();
     // Setup globals and query vars
     global $theme;
     $theme = $this;
     set_query_var('theme', $this);
     // Base path/uri
     $this->path = realpath(get_template_directory());
     $this->uri = get_template_directory_uri();
     // Build Path Variables
     $this->generate_paths(array('asset' => 'asset', 'font' => 'asset/font', 'image' => 'asset/image', 'script' => 'asset/script', 'style' => 'asset/style', 'content' => 'content', 'include' => 'include', 'template' => 'template'));
     // Theme Options
     $this->options = $this->fetch_options();
     $this->template_queue = array();
     $this->used_templates = array();
     // This is only populated if debug is active
     $this->inc_var_list = array();
     // Check POST for options update (nonce & user are verified)
     $this->update_options_via_post();
     /*** Functions (1 per file) ***/
     $this->get_functions();
     /*** Initialize all the WordPress integrations ***/
     $this->do_integrations();
     /*** Handle First Run ***/
     if ($this->get_option('first_run')) {
         // This is the first run, greet them
         template_use_part($theme->template_sub_path . '/default', $theme->template_sub_path . '/first-run');
     }
     parent::__construct();
 }