hello-theme/index.php

38 lines
1,000 B
PHP
Raw Normal View History

2018-03-19 13:51:18 +02:00
<?php
2018-12-19 14:46:42 +02:00
/**
2018-12-25 18:05:46 +02:00
* The site's entry point.
2018-12-19 14:46:42 +02:00
*
2019-07-11 18:37:10 +03:00
* Loads the relevant template part,
2018-12-19 14:46:42 +02:00
* the loop is executed (when needed) by the relevant template part.
*
* @package HelloElementor
2018-12-19 14:46:42 +02:00
*/
if ( ! defined( 'ABSPATH' ) ) {
2019-07-11 18:37:10 +03:00
exit; // Exit if accessed directly.
}
2018-03-19 13:51:18 +02:00
get_header();
$is_elementor_theme_exist = function_exists( 'elementor_theme_do_location' );
2018-03-19 13:51:18 +02:00
if ( is_singular() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/single' );
}
} elseif ( is_archive() || is_home() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/archive' );
}
} elseif ( is_search() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/search' );
}
2018-03-19 13:51:18 +02:00
} else {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/404' );
}
2018-03-19 13:51:18 +02:00
}
get_footer();