Wordpress使用主题仅限博客

时间:2014-01-01 22:33:18

标签: wordpress wordpress-theming

我希望仅将Pinbin主题用于我的Wordpress博客。我为其他一切创建了一个自定义主题,但对于博客,我想使用这个主题。

我从这个模板中获取了主索引php文件,以及页眉和页脚文件。我重命名了页眉和页脚文件,并将页眉/页脚调用更改为这些文件而不是网站其余部分使用的文件。

我将主题分配给了一个页面,但它没有显示任何帖子。代码如下:

<?php if (have_posts()) : ?>
<div id="post-area">
<?php while (have_posts()) : the_post(); ?> 
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) { ?>
<div class="pinbin-image"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail( 'summary-image' );  ?></a></div>
<div class="pinbin-category"><p><?php the_category(', ') ?></p></div>
<?php } ?>
<div class="pinbin-copy"><h2><a class="front-link" href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<p class="pinbin-date"><?php the_time(get_option('date_format')); ?>  </p>
<?php the_excerpt(); ?> 
<p class="pinbin-link"><a href="<?php the_permalink() ?>">&rarr;</a></p>
</div>
</div>       
<?php endwhile; ?>

关于我为什么没有看到任何东西的任何想法?

谢谢,S

1 个答案:

答案 0 :(得分:0)

如果没有定义其他模板,index.php文件将用作备份,如果要编辑特定页面类型,则必须编辑其他文件。请参阅WordPress codex中的template hierarchy

    +

您忘记了文件底部的endif;

Template hierachy WordPress

相关问题