/*——————————————-*/
/* New Post Display2
/*——————————————-*/
function getNewPosts($atts, $content = null) {
extract(shortcode_atts(array(
“num” => ’10′,
), $atts));
global $post;
$oldpost = $post;
$myposts = get_posts(‘numberposts=’.$num.’&order=DESC&orderby=post_date&post_type=info’);
$retHtml=’

’;
foreach($myposts as $post) :
setup_postdata($post);
/* $retHtml.=’

  • ’.the_title(“”,””,false).’
  • ’;*/
    $date = date(“Y年m月d日”,strtotime($post->post_date));
    $retHtml.=’

    ’;

    endforeach;
    $retHtml.=’

    掲載日 タイトル
    ’.$date.’ ’.the_title(“”,””,false).’

    ’;
    $post = $oldpost;
    return $retHtml;
    }
    add_shortcode(‘newpost’, ‘getNewPosts’);