2016-12-07 22 views
0

我的網頁沒有顯示任何內容,除了頁眉和頁腳我認爲它與我的佈局方式有關,但並不真正知道。WordPress的自定義主題,爲什麼我的內容沒有在頁面上顯示

的index.php和page.php文件

<?php get_header(); ?> 
<?php if(have_posts()) : the_post(); ?> 
    <?php the_content(); ?> 
<?php endif; ?> 
<?php get_footer(); ?> 
+1

''? – smoqadam

+0

你可以比較你的主題到這裏[這裏](https://github.com/taniarascia/startwordpress)或者你在這裏發佈一些更多的代碼 – Blueblazer172

+0

@smoqadam [the_content](https://developer.wordpress.org/reference/functions/the_content /)不需要回顯。 'get_the_content'需要回聲。 – janw

回答

2

你忘了while聲明。

這裏是你的代碼應該是什麼樣子?

<?php get_header(); ?> 
<?php if(have_posts()) : while (have_posts()) : the_post(); ?> 
    <?php the_content(); ?> 
<?php endwhile; endif; ?> 
<?php get_footer(); ?> 
相關問題