2ed2b25194
・ベース部分(カテゴリー、投稿)の表示順用カスタムフィールド設定登録の作成
34 lines
1.7 KiB
PHP
34 lines
1.7 KiB
PHP
<?php
|
||
$opt = get_option( 'post_cat_order' );
|
||
$category_list = post_sort_cat_order::get_category_list( $opt );
|
||
?>
|
||
<div class="post-order-box">
|
||
<form action="" method="post">
|
||
<?php wp_nonce_field( 'sh_options' ); ?>
|
||
<h2>投稿表示順設定</h2>
|
||
<div class="list-orders-outer">
|
||
<?php if ( count( $category_list ) == 0 ): ?>
|
||
<p>対象カテゴリーを選択してください。[ <a href="./admin.php?page=nb_post_sort_setting">カテゴリー選択</a> ]</p>
|
||
<?php else: ?>
|
||
<?php foreach ( $category_list as $category ): ?>
|
||
<div class="list-orders-inner">
|
||
<h3><?php echo $category->name; ?></h3>
|
||
<?php $target_posts = post_sort_cat_order::get_sort_post_list( $category->term_id ); ?>
|
||
<ul class="post-order-list">
|
||
<?php foreach ( $target_posts as $key => $target_post ): $sort_num = $key + 1; ?>
|
||
<li class="product-list">
|
||
<span class="sort-num-label"><?php echo $sort_num; ?></span>
|
||
<?php echo get_the_title( $target_post->ID ); ?>
|
||
<input type="hidden" class="list_order"
|
||
name="nb_post_cat[post_sort][<?php echo $category->term_id; ?>][<?php echo $target_post->ID; ?>]"
|
||
value="<?php echo $sort_num; ?>">
|
||
</li>
|
||
<?php endforeach; ?>
|
||
</ul>
|
||
</div>
|
||
<?php endforeach; ?>
|
||
<?php endif; ?>
|
||
</div>
|
||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
|
||
</form>
|
||
</div>
|