WordPressカスタマイズで投稿一覧に表示される「投稿者名」「コメント数」を削除したい。
テーマは「Faben」である。
content-header.php内に下記を発見。
<div class="entry-meta">
<p class="post-cat"><?php the_category( ‘ ‘ ); ?></p>
<?php
printf( __( ‘ %s / %s’, ‘farben’ ),
‘<span class="vcard author"><span class="fn"><a href="’ . get_author_posts_url( get_the_author_meta( ‘ID’ ) ) . ‘" title="’ . esc_attr( sprintf( __( ‘Posts by %s’, ‘farben’ ), get_the_author() ) ) . ‘" rel="author">’ . get_the_author() . ‘</a></span></span>’, ‘<a href="’ . get_permalink() . ‘" class="time"><time class="date published updated" datetime="’ . esc_attr( get_the_date( ‘Y-m-d’ ) ) . ‘">’ . get_the_date() . ‘</time></a>’
);
<p class="post-cat"><?php the_category( ‘ ‘ ); ?></p>
<?php
printf( __( ‘ %s / %s’, ‘farben’ ),
‘<span class="vcard author"><span class="fn"><a href="’ . get_author_posts_url( get_the_author_meta( ‘ID’ ) ) . ‘" title="’ . esc_attr( sprintf( __( ‘Posts by %s’, ‘farben’ ), get_the_author() ) ) . ‘" rel="author">’ . get_the_author() . ‘</a></span></span>’, ‘<a href="’ . get_permalink() . ‘" class="time"><time class="date published updated" datetime="’ . esc_attr( get_the_date( ‘Y-m-d’ ) ) . ‘">’ . get_the_date() . ‘</time></a>’
);
if ( comments_open() )
echo ‘ / ’;
comments_popup_link( __( ‘0 Comments’, ‘farben’ ), __( ‘1 Comment’, ‘farben’ ), __( ‘% Comments’, ‘farben’ ), ”, ” );
?>
</div>
printf()ってなんだ?と調べてみるとC言語?
https://www9.plala.or.jp/sgwr-t/c/sec05.html
いやはや、PHPもわからないのにC言語とかまで出てくるとしたら、混乱する・・・。
しかし、本当にC言語なのかな?
結局、下記の様に修正をし、削除できたので記録します。
<div class="entry-meta">
<p class="post-cat"><?php the_category( ‘ ‘ ); ?></p>
<?php
printf( __( ‘%s’, ‘farben’ ),
‘<a href="’ . get_permalink() . ‘" class="time"><time class="date published updated" datetime="’ . esc_attr( get_the_date( ‘Y-m-d’ ) ) . ‘">’ . get_the_date() . ‘</time></a>’
);
<p class="post-cat"><?php the_category( ‘ ‘ ); ?></p>
<?php
printf( __( ‘%s’, ‘farben’ ),
‘<a href="’ . get_permalink() . ‘" class="time"><time class="date published updated" datetime="’ . esc_attr( get_the_date( ‘Y-m-d’ ) ) . ‘">’ . get_the_date() . ‘</time></a>’
);
if ( comments_open() )
echo ‘ / ’;
?>
</div>
コメント