プロジェクト

全般

プロフィール

サポート #2522

未完了
山武 山武

サイト修正

サポート #2522: サイト修正

山谷 武史 さんが2日前に追加. 1日前に更新.

ステータス:
フィードバック
優先度:
通常
担当者:
開始日:
2026/04/14
期日:
2026/04/15 (1日 遅れ)
進捗率:

50%

予定工数:

説明

指示内容

■土地情報ページの文言差し替え
https://www.kyoueihouse.jp/land/info.html
上記ページの冒頭文を以下に差し替え
ーーーーーーーーーー
協栄ハウスでは、土地バンクを使用し過去・最新の土地の販売状況や周辺環境をボタン1つでその場でリアルタイムに確認し、ご希望の土地情報をお届けする体制を整えています。
ーーーーーーーーーー

■新着情報
新着情報の投稿から1週間、記事タイトルの頭に「NEW」を付けたい


ファイル

Screenshot 2026-04-14 at 15.39.32.png (78.8 KB) Screenshot 2026-04-14 at 15.39.32.png アルドリノ デフリン, 2026/04/14 15:55
Screenshot 2026-04-14 at 15.20.41.png (261 KB) Screenshot 2026-04-14 at 15.20.41.png アルドリノ デフリン, 2026/04/14 15:55
Screenshot 2026-04-14 at 15.41.01.png (125 KB) Screenshot 2026-04-14 at 15.41.01.png アルドリノ デフリン, 2026/04/14 15:55
Screenshot 2026-04-14 at 15.39.32.png
Screenshot 2026-04-14 at 15.20.41.png
Screenshot 2026-04-14 at 15.41.01.png

アデ アルドリノ デフリン さんが1日前に更新 操作 #1

  • ステータス新規 から 進行中 に変更
  • 進捗率0 から 30 に変更

アデ アルドリノ デフリン さんが1日前に更新 操作 #2

Screenshot 2026-04-14 at 15.20.41.png
Screenshot 2026-04-14 at 15.39.32.png
Screenshot 2026-04-14 at 15.41.01.png

土地情報ページの文言差し替え

管理画面 > コンテンツ編集 > 土地情報 から文言を編集しました。

新着情報

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>

他の形式にエクスポート: PDF Atom