• Hi all,
    I have created a taxonomy that name is “type”. In this taxonomy, I have 80 terms. Similar :: Books, Pens, Pencils, CDs,… Also I have created a page that name is “productions.php” for show this terms. With This Plugin, I attach image to my terms :
    Taxonomy images

    But The 80s item is very long in one page and I am going to pagination productions.php, Similar pagination posts. (I want to pagination taxonomy terms in page)
    Sample:
    /productions
    /productions/page/2
    /productions/page/3

    This is my code :

    <?php //list terms in a given taxonomy using wp_list_categories(also useful as a widget)
    
    		$args = array(
    			'taxonomy' 		=> 'type',
    			'term_args' => array(
    				'orderby' 		=> 'name',
    				'title_li' 		=> '',
    				'hide_empty' 	=> 0,
    				'parent'		=> 0,
    			)
    		);
    		?>
    
    		<?php
    		$terms = apply_filters( 'taxonomy-images-get-terms', '', $args );
    
    		if ( ! empty( $terms ) ):
    		?>
    		<?php foreach( (array) $terms as $term ): ?>
    
    		<ul class="category">
    			<li class="thumb"><a href="<?php echo esc_url( get_term_link( $term, $term->taxonomy ) ); ?>"><?php echo wp_get_attachment_image( $term->image_id, 'full' )?></a></li>
    			<li><a href="<?php bloginfo('url') ?><?php echo '/'.$term->taxonomy.'/'.$term->slug ?>"><?php echo $term->name; ?></a></li>
    		</ul>
    		<?php endforeach; ?>
    		<?php endif; ?>

    ,…
    Can anybody help me?
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter adibbehrooz

    (@adibbehrooz)

    Nobody can help me?

    This is sample of page (galleries.php) that I show terms with image:
    Badrossama Gallery

    First off … you should never, ever created a custom taxonomy named “type” as it is in the Reserved Terms list. Doing so will creates issues in places you would never expect. I would suggest changing it to “production_type” or better yet “mytheme_production_type”. Using your theme name as a prefix will avoid potential future conflicts.

    As for the paging code. You can either:

    A: Learn from the code posted here: https://github.com/mfields/taxonomy-list-shortcode/blob/master/taxonomy-list-shortcode.php#L32 This is from the next version of my Taxonomy List Shortcode plugin. The code is currently not ready to go, but the paging code is stable and tested.

    B: Wait for me to finish-up and release the plugin. Should be a week or two. This plugin will have two custom templates that provide support for displaying images saved by the Taxonomy Images plugin.

    Best,
    -Mike

    Try this code.

    <?php //list terms in a given taxonomy using wp_list_categories(also useful as a widget)
    
    		$args = array(
    			'taxonomy' 		=> 'type',
    			'term_args' => array(
    				'orderby' 		=> 'name',
    				'title_li' 		=> '',
    				'hide_empty' 	=> 0,
    				'parent'		=> 0,
    			),
                            'posts_per_page' => '50',
                            'paged' => $paged
    		);
    		?>
    
    		<?php
    		$terms = apply_filters( 'taxonomy-images-get-terms', '', $args );
    
    		if ( ! empty( $terms ) ):
    		?>
    		<?php foreach( (array) $terms as $term ): ?>
    
    		<ul class="category">
    			<li class="thumb"><a href="<?php echo esc_url( get_term_link( $term, $term->taxonomy ) ); ?>"><?php echo wp_get_attachment_image( $term->image_id, 'full' )?></a></li>
    			<li><a href="<?php bloginfo('url') ?><?php echo '/'.$term->taxonomy.'/'.$term->slug ?>"><?php echo $term->name; ?></a></li>
    		</ul>
    		<?php endforeach; ?>
    		<?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination Taxonomy Terms’ is closed to new replies.