my code it's this, and i can't create the pagination for that, its working good the pages 1, 2, 3 and etc.. but its just that the pagination links are not showing in the template.
I created a template for show all the custom taxonomies with the pictures and etc.. its just that not appear's the numbers of pagination but its working the pages writing manual.
my code its this.
<?php
// Get the taxonomy's terms
$terms = get_terms(
array(
'taxonomy' => 'girls',
'hide_empty' => false,
'orderby' => 'count',
'order' => 'DESC',
'posts_per_page' => 5,
'number' => 5,
)
);
// Check if any term exists
if ( ! empty( $terms ) && is_array( $terms ) ) {
// Run a loop and print them all
foreach ( $terms as $term ) { ?>
<div class="item">
<div class="pornstars-box-stars">
<div class="video-pornstar">
<a class="estrella-enlace" href="<?php echo bloginfo( 'url' ); ?>?girls=<?php echo $term->slug; ?>" title="<?php echo $term->name; ?>">
<?php
$image_id = get_term_meta( $term->term_id, 'girls-image-profile', true );
$cat_image = wp_get_attachment_image( $image_id, 'video-thumb' );
if ( $cat_image ){
echo $cat_image;
}else{
$thumb_url = '';
if ( has_post_thumbnail() ) {
$thumb_url = get_the_post_thumbnail_url( get_the_id(), 'video-thumb' );
} elseif ( '' !== get_post_meta( get_the_ID(), 'thumb', true ) ) {
$thumb_url = get_post_meta( get_the_ID(), 'thumb', true );
}
if ( empty( $thumb_url ) ) {
$thumb_url = get_stylesheet_directory_uri() . '/img/no-thumb.png';
}
echo '<img class="video-img img-fluid" data-src="' . esc_url( $thumb_url ) . '">';
}
?>
<span class="titulo-estrella"><?php echo $term->name; ?></span>
<div class="estrella-contador">
<?php echo intval( $term->count ) ?> videos
</div>
</a>
</div>
</div>
</div>
<?php
}
} ?>
</div>
</div>
</div>
</div>
</div>
<div class="pagination">
<div class="pagination-box">
<?php pagination('«', '»'); ?>
</div>
</div>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742298186a4417540.html
评论列表(0条)