Skip to content

Commit

Permalink
Update template structure and improve accessibility in page.php
Browse files Browse the repository at this point in the history
The structure of the 'page.php' template of WP Kit Elementor theme has been updated to improve semantics and accessibility. The changes include:
- Addition of a check to exit if the file is accessed directly for improved security.
- Use of 'div' instead of 'main' as main content wrapper, improving HTML semantics for better representation.
- A shift in the sequence of template parts being called for a more logical layout rendering.
These modifications aim to enhance the overall user experience and adherence to best practices in web development.
  • Loading branch information
garikhg committed Dec 3, 2023
1 parent bd13faf commit 20e82dc
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions page.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
<?php
/**
* The template for displaying all single posts
*
* @package WPKitElementor
*/

get_header();

while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/header/page-header' );
get_template_part( 'template-parts/content/content-page' );
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

get_footer();
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/header/page-header' );
get_template_part( 'template-parts/content/content-page' );
}
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>

0 comments on commit 20e82dc

Please sign in to comment.