Title: Working with get_terms
Last modified: August 31, 2016

---

# Working with get_terms

 *  [TakiraThemes](https://wordpress.org/support/users/takirathemes/)
 * (@takirathemes)
 * [10 years ago](https://wordpress.org/support/topic/working-with-get_terms/)
 * Hi,
 * I’m using the get_terms function to display the terms images, I can’t seem to
   work a way to display the pagination of them,
 * Here is my code, the pagination appears but when I go to another page it just
   displays the same posts without offsetting them
 * `<article class=”inner-content”>
 *  <?php the_field(text’, ‘option’); ?>
    <ul class=”list”> <?php $paged = ( get_query_var(‘
   paged’ ) ) ? get_query_var( ‘paged’ ) : 1; $args = array( ‘taxonomy’ => ‘issues’,‘
   term_args’ => array ( ‘hide_empty’ => true ), ‘paged’ => $paged );
 *  $terms = apply_filters( ‘taxonomy-images-get-terms’, ”, $args);
 *  foreach( (array) $terms as $term) {
    echo ‘
    - ‘;
       echo ‘[name ) . ‘” ‘ . ‘>’ . wp_get_attachment_image( $term->image_id, ‘issue’ ) . ” . $term->name . ‘](https://wordpress.org/support/topic/working-with-get_terms/&apos; . esc_attr( get_term_link( $term ) ) . &apos;?output_format=md)‘;
      echo ‘
    - ‘;
       }
    -  ?>
    -  <?php wp_pagenavi(); ?>
    -  </article>
    - [https://wordpress.org/plugins/wp-pagenavi/](https://wordpress.org/plugins/wp-pagenavi/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [TakiraThemes](https://wordpress.org/support/users/takirathemes/)
 * (@takirathemes)
 * [10 years ago](https://wordpress.org/support/topic/working-with-get_terms/#post-7352848)
 * Got it to work, there seem to be a different problem now that the pagination 
   is showing one more page then it should, it showing 2 pages but the second page
   has no posts,
 *     ```
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
   
       			    $per_page    = 10;
   
       				$total_terms = count( get_terms( 'issues' ) );
       				$offset      = $per_page * ( $paged - 1) ;
   
       				$args = array(
       			        'taxonomy' => 'issues',
       					'term_args' => array
       					(		'hide_empty' => true,
       							'number' => $per_page,
       							'offset' => $offset
       			                ),
       			    );
   
       				$terms = apply_filters( 'taxonomy-images-get-terms', '', $args);
   
       				foreach( (array) $terms as $term) {
       					echo '<li>';
       					echo '<a href="' . esc_attr( get_term_link( $term ) ) . '" title="' . sprintf( __( "%s" ), $term->name ) . '" ' . '>' . wp_get_attachment_image( $term->image_id, 'issue' ) . '' . $term->name . '</a>';
       					echo '</li>';
       				}
   
       				?>
       </ul>
   
       			 <?php wp_pagenavi(); ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Working with get_terms’ is closed to new replies.

 * ![](https://ps.w.org/wp-pagenavi/assets/icon.svg?rev=977997)
 * [WP-PageNavi](https://wordpress.org/plugins/wp-pagenavi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-pagenavi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-pagenavi/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-pagenavi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-pagenavi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-pagenavi/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [TakiraThemes](https://wordpress.org/support/users/takirathemes/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/working-with-get_terms/#post-7352848)
 * Status: not resolved