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