Files
POST_ORDER_BY_ARCHIVE/template/sort.php
T
nobu 2ed2b25194 WP PLUGIN アーカイブ毎に投稿表示順を設定する
・ベース部分(カテゴリー、投稿)の表示順用カスタムフィールド設定登録の作成
2021-05-03 18:51:02 +09:00

34 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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>