Reputation: 818
I'm loading a front-end site onto a html5blank wordpress theme. The header.php and footer.php files are working fine but my first get_template_part() section won't show up. I've looked through the template hierarchy and I can't see what could be causing the issue.
This is how I have my code -
whatwedo.php
<?php /* Template Name: whatwedo */ ?>
<section id="what">
<!-- whatwedo template code -->
</section>
index.php
<?php get_header(); ?>
<!-- section -->
<section>
<?php get_template_part('whatwedo'); ?>
</section>
<!-- /section -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
page-home.php
<?php get_header(); ?>
<?php get_template_part('whatwedo'); ?>
<?php the_content(); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
I'm not sure whether the template name should go in index.php or page-home.php but either way it should show up shouldn't it? I only have two pages set up in the dashboard so far - home and blog - and I'm pretty sure they're set up correctly.
Can anyone see why this might be happening?
Upvotes: 0
Views: 1205
Reputation: 1
Try getting rid of the <?php /* Template Name: whatwedo */ ?>
. That's specifically for a template, not a template part.
That part creates a new template (which can be selected from the page editor in the admin section).
Upvotes: 0