Skip to content

Instantly share code, notes, and snippets.

@amitrahav
Created October 10, 2019 07:40
Show Gist options
  • Save amitrahav/ebe0f942b52a656c92c9ffccd16151be to your computer and use it in GitHub Desktop.
Save amitrahav/ebe0f942b52a656c92c9ffccd16151be to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<?php
global $post;
$slug;
if (is_front_page()) {
$slug = "front";
} else if (file_exists(locate_template('partials/content-' . $post->post_name . '.php'))) {
$slug = $post->post_name;
} else {
$slug = $post->post_type;
}
?>
<div class="container" id="container" data-page="<?php echo $slug; ?>">
<?php include(locate_template('partials/content-' . $slug . '.php')); ?>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment