if ( ! defined( 'ABSPATH' ) ) {
exit;
}
get_header();
<div class="front-page">
<header>
get_template_part('template-parts/content','header');
</header>
<main>
while ( have_posts() ) :
the_post();
the_content();
endwhile;
</main>
<footer>
get_template_part('template-parts/content','footer');
</footer>
</div>
get_footer()
/*
Theme Name: Mon Thème Minimal
Theme URI: https://example.com
Author: Ton Agence
Author URI: https://example.com
Description: Thème WordPress minimal pour démarrage rapide.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: mon-theme-minimal
*/
/* Reset très basique */
body {
margin: 0;
font-family: system-ui, -apple-system, sans-serif;
line-height: 1.5;
color: #222;
}
.container {
max-width: 960px;
margin: 0 auto;
padding: 24px;
background-color: pink;
}
define("WEBSITE_VERSION", '1.0.0');
function monsite_setup() {
add_theme_support('title-tag');
add_theme_support('post-thumbnails');
add_theme_support('html5', [
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
]);
}
add_action('after_setup_theme', 'monsite_setup');
function monsite_enqueue_assets() {
wp_enqueue_style(
'main-style',
get_stylesheet_directory_uri() . "/assets/style/css/main.css",
[],
WEBSITE_VERSION
);
wp_enqueue_script(
'main-js',
get_stylesheet_directory_uri() . "/assets/js/main.js",
["jquery"],
WEBSITE_VERSION,
true
);
}
add_action('wp_enqueue_scripts', 'monsite_enqueue_assets');