[過去ログ] 【PHP】下らねぇ質問はここに書き込みやがれ 12 (1002レス)
上下前次1-新
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
408: (オッペケ Sr23-x1uT) 2021/07/06(火)14:16 ID:K/Yz4VXdr(1) AAS
//ここにメイン部分のコードを記述 ループしないので <php if (have_posts()) : the_post(); >
<!--クラスつきのタイトルを追加-->
<h3><php the_title(); ></h3>
<!--クラスつきの日付けを追加-->
<div class="posted_date">
<php echo get_the_date(); ?> </div>
<!--リンククラス付きのカテゴリーを追加-->
<php
$categories = get_the_category();
if ( $categories ) {
echo '<ul>';
foreach ( $categories as $category ) {
echo '<li class="cat2"'.$category->slug.'"><a href="'.esc_url(get_category_link($category->term_id)).'">'.$category->name.'</a></li>';
}
echo '</ul>';
} ?>
<!--リンククラス付きのコメント数を追加-->
<php $num_comments = get_comments_number();
if ( $num_comments == 0 ) {
$comments = __('No Comments'); // 댓글이 없을 경우
} elseif ( $num_comments > 1 ) {
$comments = $num_comments . __(' Comments'); // 댓글이 2개 이상일 경우
} else {
$comments = __('1 Comment'); // 댓글이 1개일 경우
}
$write_comments = '<span class="singlecomments2"><a href="' . get_comments_link() .'">'. $comments.'</a></span>';
echo $write_comments;?>
<!--クラス付きの内容を追加-->
<div class="posted_content">
<php echo the_content(); > </div>
<php
endif;?> で出力してるんですが<!--クラス付きの内容を追加-->の部分のみ繰り返し出力する場合どうすればいいんでしょうか?
上下前次1-新書関写板覧索設栞歴
あと 594 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.008s