Skip to content

Instantly share code, notes, and snippets.

@eliasfaical
Created January 24, 2022 16:50
Show Gist options
  • Save eliasfaical/16b71008072be9fb2d3996ee4d3fa721 to your computer and use it in GitHub Desktop.
Save eliasfaical/16b71008072be9fb2d3996ee4d3fa721 to your computer and use it in GitHub Desktop.
Default page WP
<?php
get_header();
$current_page = basename(get_permalink());
?>
<main id="main" class="site-main main-<?php echo $current_page; ?>">
<?php
switch ($current_page) {
case $current_page:
get_template_part( 'template-parts/content', $current_page );
break;
default:
get_template_part( 'template-parts/content' );
break;
}
?>
</main>
<?php
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment