飛ばしたいリンクがあればそこへ
本文空ならURLなし
本文ありなら本文
カスタムフィールドスイートで
info_url
エクスポート
[{"post_title":"\u30a4\u30f3\u30d5\u30a9\u30e1\u30fc\u30b7\u30e7\u30f3\u30ab\u30c6\u30b4\u30ea\u7528","post_name":"%e3%82%a4%e3%83%b3%e3%83%95%e3%82%a9%e3%83%a1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e7%94%a8","cfs_fields":[{"id":26,"name":"info_url","label":"INFO URL","type":"text","notes":"\u30bf\u30a4\u30c8\u30eb\u304b\u3089\u98db\u3070\u3057\u305f\u3044\u30da\u30fc\u30b8\u304c\u3042\u308c\u3070\u30b3\u30b3\u306bURL\u3092\u30b3\u30d4\u30da","parent_id":0,"weight":0,"options":{"default_value":"","required":"0"}}],"cfs_rules":{"post_types":{"operator":"==","values":["post"]}},"cfs_extras":{"order":"0","context":"normal","hide_editor":"0"}}]
<h3 class="top_koushin_titel">
<i class=" icon-dot-circled"></i> インフォメーション</h3>
<?php
$args = array(
'posts_per_page' => 3,
'cat' => 30,
);
query_posts( $args );
if ( have_posts () ) :
while ( have_posts() ) :
the_post();
?>
<div class="set_day_all clearfix">
<div class="set_day"><?php the_time('Y.m.d'); ?></div>
<div class="set_title">
<?php if(post_custom('info_url')): ?>
<a href="<?php echo post_custom('info_url'); ?>"><?php the_title(); ?></a>
<?php else: ?>
<?php if($post->post_content=="") : //本文空なら?><?php the_title(); ?>
<?php else: //?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php
endwhile;
else:?>
<div style="margin-left:20px;">記事はまだありません。</div>
<?php
endif;
?>
<!------------------------------------------------リセットクエリ--------------------------------------------->
<?php wp_reset_query(); ?>
<div style="text-align:right; padding-top:15px; padding-bottom:15px; padding-right:15px;">
<a href="<?php echo home_url(); ?>/?cat=30" style="color:#FF3300; font-size:13px;">すべて見る ▶▶</a>
</div>