操作
サポート #2522
未完了
山武
山武
サイト修正
サポート #2522:
サイト修正
開始日:
2026/04/14
期日:
2026/04/15 (1日 遅れ)
進捗率:
50%
予定工数:
対象ページURL:
説明
指示内容¶
■土地情報ページの文言差し替え
https://www.kyoueihouse.jp/land/info.html
上記ページの冒頭文を以下に差し替え
ーーーーーーーーーー
協栄ハウスでは、土地バンクを使用し過去・最新の土地の販売状況や周辺環境をボタン1つでその場でリアルタイムに確認し、ご希望の土地情報をお届けする体制を整えています。
ーーーーーーーーーー
■新着情報
新着情報の投稿から1週間、記事タイトルの頭に「NEW」を付けたい
ファイル
アデ アルドリノ デフリン さんが1日前に更新
- ステータス を 新規 から 進行中 に変更
- 進捗率 を 0 から 30 に変更
アデ アルドリノ デフリン さんが1日前に更新
- ファイル Screenshot 2026-04-14 at 15.20.41.png Screenshot 2026-04-14 at 15.20.41.png を追加
- ファイル Screenshot 2026-04-14 at 15.39.32.png Screenshot 2026-04-14 at 15.39.32.png を追加
- ファイル Screenshot 2026-04-14 at 15.41.01.png Screenshot 2026-04-14 at 15.41.01.png を追加
- ステータス を 進行中 から フィードバック に変更
- 担当者 を アルドリノ デフリン から 山谷 武史 に変更
- 進捗率 を 30 から 50 に変更
土地情報ページの文言差し替え¶
管理画面 > コンテンツ編集 > 土地情報 から文言を編集しました。
新着情報¶
func_com.php に以下の関数を追加。
function cld_is_new_post($post_id)
{
$date = get_the_date('Y/m/d', $post_id);
$today = new DateTime('today', wp_timezone());
$is_new_start = new DateTime($date, wp_timezone());
$is_new_end = clone $is_new_start;
$is_new_end->modify('+1 week');
return $is_new_start <= $today && $is_new_end >= $today;
}
上記の関数で出力時に判定するように修正。
archive.php
<dl class="mb-5">
<?php
if (have_posts()) :
while (have_posts()) :
the_post();
$post_id = get_the_ID();
$title = get_the_title($post_id);
$link = get_the_permalink($post_id);
$categories = get_the_category($post_id);
$category = !empty($categories) ? $categories[0] : null;
$date = get_the_date('Y/m/d', $post_id);
$is_new = cld_is_new_post($post_id); ?>
<div>
<dt>
<?= esc_html($date); ?>
<?php if (!empty($category)) : ?>
<span class="label-<?= esc_attr($category->slug); ?>"><?= esc_html($category->name); ?></span>
<?php endif; ?>
</dt>
<dd>
<a href="<?= esc_url($link); ?>" class="text-decoration-none">
<span class="news-title">
<?php if ($is_new) : ?>
<span class="badge bg-main text-white me-1">NEW</span>
<?php endif; ?>
<?= esc_html($title); ?>
</span>
</a>
</dd>
</div>
<?php endwhile; ?>
<?php endif; ?>
</dl>
block/index_news.php
<dl>
<?php
if (!empty($obj)) :
foreach ($obj as $post) :
$title = get_the_title($post->ID);
$link = get_the_permalink($post->ID);
$date = get_the_date('Y.m.d', $post->ID);
$category = get_the_category($post->ID);
$category = !empty($category) ? $category[0] : null;
$is_new = cld_is_new_post($post->ID); ?>
<div>
<dt><?= esc_html($date); ?><span><?= esc_html($category->name); ?></span></dt>
<dd>
<a href="<?= esc_url($link); ?>">
<?php if ($is_new) : ?>
<span class="badge bg-main text-white me-1">NEW</span>
<?php endif; ?>
<?= esc_html($title); ?>
</a>
</dd>
</div>
<?php endforeach; ?>
<?php else : ?>
<dt>
<p>現在、新着情報はありません。</p>
</dt>
<?php endif; ?>
</dl>
操作