i built a custom wordpress theme, and for some reason don’t know why the posts/pages are not showing up in the theme, but they show up in all other themes. Here is the index.php code:
<?php get_header( ); ?>
<div id = "contentwrapper">
<div id = "content" role = "main">
<div id = "leftcolumn">
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php endif; ?>
<div id = "locationimageslider">
</div>
<div id = "locations">
<div class = "location" name = "loc1">
<p class = "title"> Cafe Coyote </p>
<p class = "phone"> (619)291-4695 </p>
<p class = "description"> <span>3:30PM to 6PM: </span> $2 tacos, $3 beers & $4 margaritas. </p>
<div id = "ratings">
</div>
<div id = "imthere">
</div>
</div>
<div class = "location" name = "loc1">
<p class = "title"> Cafe Coyote </p>
<p class = "phone"> (619)291-4695 </p>
<p class = "description"> <span>3:30PM to 6PM: </span> $2 tacos, $3 beers & $4 margaritas. </p>
<div id = "ratings">
</div>
<div id = "imthere">
</div>
</div>
</div>
</div>
<?php get_sidebar( ); ?>
</div>
</div>
<?php get_footer( ); ?>
</body>
</html>
here is the page.php code:
<?php get_header( ); ?>
<div id = "contentwrapper">
<div id = "content" role = "main">
<?php the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php get_sidebar( ); ?>
</div>
</div>
<?php get_footer( ); ?>
</body>
</html>
Try this basic template layout
In both
index.php
andpage.php
, you’re calling:Does your Theme have
content-page.php
orcontent.php
files?(Note: you should probably be using a
content.php
file inindex.php
, and callget_template_part( 'content' )
.In
page.php
, you’re not calling the Loop properly. You have:…instead of:
That may or may not cause a problem.