WP PLUGIN アーカイブ毎に投稿表示順を設定する
・ベース部分(カテゴリー、投稿)の表示順用カスタムフィールド設定登録の作成
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
//各種パラメータ
|
||||
$all_categories = get_categories();
|
||||
?>
|
||||
|
||||
<div class="post-order-box">
|
||||
<form action="" method="post">
|
||||
<?php
|
||||
wp_nonce_field( 'sh_options' );
|
||||
$opt = get_option( 'post_cat_order' );
|
||||
?>
|
||||
<h2>対象カテゴリー選択</h2>
|
||||
<ul class="order_setting_list">
|
||||
<?php foreach ( $all_categories as $category ): ?>
|
||||
<li>
|
||||
<div class="select_cat">
|
||||
<label>
|
||||
<input type="hidden"
|
||||
name="post_cat_order[target_cat][<?php echo $category->slug; ?>]"
|
||||
value="0">
|
||||
<input type="checkbox"
|
||||
name="post_cat_order[target_cat][<?php echo $category->slug; ?>]"
|
||||
<?php echo checked( $opt['target_cat'][ $category->slug ], 1 ); ?>
|
||||
value="1">
|
||||
<?php echo $category->name; ?>
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user