WP-PageNaviのphpコードをfunctions.phpに書くには
-
この様なコードでカスタム投稿タイプの記事一覧を表示しています。
function getCatsample($atts, $content = null) { extract( shortcode_atts(array( "num" => '0' ), $atts)); global $post; $oldpost = $post; $myposts = get_posts('numberposts='.$num.'&post_type=committee&order=DESC&orderby=post_date&tag=other'); $retHtml='<dl class="dl_archive">'; foreach($myposts as $post) : setup_postdata($post); $retHtml.='<dt>'.get_post_time('Y年m月d日').'</dt>'; $retHtml.='<dd><a href="'.get_permalink().'">'.the_title("","",false).'</a></dd>'; endforeach; $retHtml.='</dl>'; restore_current_blog(); $post = $oldpost; return $retHtml; } add_shortcode("sample", "getCatsample");
この中にプラグインのページナビを呼び出すコードの
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
を記入したいのですが、どの様に記入すれば良いのでしょうか。どなたかどうか教えて下さい。
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「WP-PageNaviのphpコードをfunctions.phpに書くには」には新たに返信することはできません。