私のテーマデベロッパーは、このテーマを現在のテーマに追加する方法について私に答えてくれません。私はWordpressのドキュメントを調べ、function.phpファイルにコードを追加しようとしましたが、コードをページの上部に配置しました。私はWordpressが提案するPHPコードを追加しようとしましたが、それはテーマを壊しました。Wordpressの追加更新された投稿日付PHP
このように見えるのは、カスタムテーマであるカスタムコードです。
どのようなヘルプも大歓迎です。
現在:CATEGORYで
2017年7月11日0コメント
は持ってみる:CATEGORYで
2017年7月11日0コメント
更新:7月23日、 2017 at 7:00 am
<!-- ARTICLE DATE : begin -->
`<div class="article-date">
<i class="ico tp tp-clock2"></i>
<span class="article-date-holder">
<?php if (lsvr_get_field('article_detail_categories_enable', true, true)) : ?>
<?php $categories_html = ''; ?>
<?php $terms = wp_get_post_terms(get_the_id(), 'category'); ?>
<?php foreach ($terms as $term) : ?>
<?php $categories_html .= '<a href="' . get_term_link($term) . '">' . $term->name . '</a>, '; ?>
<?php endforeach; ?>
<?php if ($categories_html !== '') : ?>
<?php $categories_html = rtrim($categories_html, ', '); ?>
<?php echo sprintf('%s in %s', get_the_date(), $categories_html); ?>
<?php else: ?>
<?php echo get_the_date(); ?>
<?php endif; ?>
<?php else: ?>
<?php echo get_the_date(); ?>
<?php endif; ?>
</span>
<?php if (lsvr_get_field('article_detail_author_enable', false, true)) : ?>
<span class="article-author">
<?php echo sprintf('by %s', get_the_author_posts_link()); ?>
</span>
<?php endif; ?>
<?php if(comments_open()) : ?>
<span class="article-comments">
<?php $comment_count = get_comment_count(get_the_ID()); ?>
<a href="<?php the_permalink(); ?>#comments"><?php echo @sprintf(__('%d comments', 'lsvrtheme'), $comment_count['approved']); ?></a>
</span>
<?php endif; ?>
</div>`
<!-- ARTICLE DATE : end -->
これはarticle.phpという特別なセクションにあります – NorthwoodsCreative