/* 誕生日から年齢を算出 [get_age birth="19850101"] */ function sc_get_age($atts) { extract(shortcode_atts(array( 'birth' => '', ), $atts)); return (int)((date('Ymd') - $birth)/10000); } add_shortcode('get_age', 'sc_get_age');
[get_age birth="19850101"]才
フッターのテンプレートの該当位置に下のコードを挿入してください。
Copyright© 2011–<?php echo date('Y'); ?> <?php bloginfo('name'); ?> All rights reserved.