最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - get_terms pagination

programmeradmin0浏览0评论

Anyone know how to paginate this get_terms function in wordpress, I tried some options but nothing worked, perhaps its because of the label?

<div class="comp-modal-content">
</ul> <form action="" method="post">
                    <?php
$args = array('hide_empty' => false,
                        'orderby'  => 'id');
                    $terms = get_terms( 'compliment', $args );
                    if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
                        echo '<ul class="comp-user-ul">';
                        $count = 0;
                        foreach ( $terms as $term ) {
                            $count++;
                            $t_id = $term->term_id;
                            $term_meta = get_option( "taxonomy_$t_id" );
?>                   
 <label>
                                    <input type="radio" name="term_id" value="<?php echo $term->term_id; ?>" <?php if ($count == 1) { echo 'checked="checked"'; } ?>>
                                <span>
                                    <img style="height: 50px; width: 50px; vertical-align:middle" src='<?php echo esc_attr( $term_meta['compliments_icon'] ) ? esc_attr( $term_meta['compliments_icon'] ) : ''; ?>' class='preview-upload'/>
                                                                    </span>
                                </label>                      
                        <?php
                        }
                        echo '</ul>';

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论