0
我已经加入到我的单post.php中显示日志分类标题上面的代码,它看起来在这里很好: http://thenoirportrait.com/2014/08/23/review-chanel-perfection-lumiere-velvet/添加类别单后页面
但不是在这里: http://thenoirportrait.com/2015/03/04/interior-design-black-home/
我有不同的发布模板。我能做些什么来使这个类别在每一篇文章中都有所改变?
我想我应该把我的类别代码放入Archives.php,但我不确定在哪里。我不想搞乱我的代码,欢迎任何帮助。
这是我的时刻:
<div class="row<?php echo (($behind_title_fw) ? ' full-width' : ''); ?>">
<div class="inner_content">
<div class="row<?php echo (($has_sidebar) ? ' has-sidebar' : ''); ?>">
<div itemscope="" itemtype="http://schema.org/BlogPosting">
<?php if($sidebar_below_title && !$is_endless_template) : ?>
<div class="medium-12">
<?php foreach((get_the_category()) as $category) {
echo $category->cat_name . ' ';
}
?>
<br>
<br>
<article id="post-header-<?php the_ID(); ?>" class="article-header-above" data-postid="<?php echo esc_attr($post->ID); ?>" data-guid="<?php echo esc_attr(get_the_guid($post->ID)); ?>" data-permalink="<?php echo esc_url(get_permalink($post->ID)); ?>">
谢谢
感谢您的回复。我试图做到这一点,但没有出现类别。 我将我的帖子更新为我的代码现在的样子 – 2015-03-30 23:52:58
@TatianaH尝试之前的代码如何? – emibloque 2015-03-31 19:57:42
这是相同的,但没有分类代码: <?php foreach((get_the_category())作为$ category){ echo $ category-> cat_name。 ''; } ?>
– 2015-04-01 13:50:33