【ブロック対応完了】年齢自動更新

※このショートコードは、「ブロックエディタ」に対応済みです。ブロックエディタのほうを使ったほうがラクです。

生年月日を記入すると、現在の年齢を計算して自動で毎年更新するショートコードです。年齢以外にも年数の経過表示にも使えます。

サンプル

元SMAP TOKIO
中居正広(51) 城島茂(53)
木村拓哉(51) 松岡昌宏(47)
稲垣吾郎(50) 国分太一(49)
草彅剛(49) 長瀬智也(45)
香取慎吾(47)
森且行(50) 山口達也元メンバー(52)
<table class=" tab_black tab_normal">
<tbody>
<tr>
<th style="width: 310px; background-color: #c93a40; color: #;">元SMAP</th>
<th style="width: 310px; background-color: #0074bf; color: #;">TOKIO</th>
</tr>
<tr>
<td style="background-color: #; color: #;">中居正広([age birth="19720818"])</td>
<td style="background-color: #; color: #;">城島茂([age birth="19701117"])</td>
</tr>
<tr>
<td style="background-color: #; color: #;">木村拓哉([age birth="19721113"])</td>
<td style="background-color: #; color: #;">松岡昌宏([age birth="19770111"])</td>
</tr>
<tr>
<td style="background-color: #; color: #;">稲垣吾郎([age birth="19731208"])</td>
<td style="background-color: #; color: #;">国分太一([age birth="19740902"])</td>
</tr>
<tr>
<td style="background-color: #; color: #;">草彅剛([age birth="19740709"])</td>
<td style="background-color: #; color: #;">長瀬智也([age birth="19781107"])</td>
</tr>
<tr>
<td style="background-color: #; color: #;">香取慎吾([age birth="19770131"])</td>
<td style="background-color: #; color: #;">-</td>
</tr>
<tr>
<td style="background-color: #; color: #;">森且行([age birth="19740219"])</td>
<td style="background-color: #; color: #;">山口達也元メンバー([age birth="19720110"])</td>
</tr>
</tbody>
</table>

書式

[age birth=""]

属性値

birth=””
誕生日の日付。Ymd形式(2015年2月4日の場合:20150204 )の半角数字

※半角数字以外を設定すると「?」が表示されます。
※現在の日付よりあとの日付を設定した場合は「0」が表示されます。

応用技

[age birth="00000101"]と記入すると、現在の西暦を毎年自動で更新できます。「2024年最新版」のような使い方ができます。

以上、「年齢自動更新ショートコード」でした。

般若ビルダー専用ショートコード一覧に戻る