首页 文章

Wordpress使用主题仅限博客

提问于
浏览
0

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

我从这个模板中获取了主索引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

    如果要编辑某个页面类型, index.php 文件必须编辑其他文件, index.php 文件将用作备份 . 请参阅WordPress codex中的template hierarchy .

    您忘记了文件底部的 endif; .

    Template hierachy WordPress

相关问题