我想添加一行代码,将分类法分页到多个页面。这个lin是我创建的一个函数,名为
wp初学者\\u numeric\\u posts\\u nav();
但每次我在foreach close paracket之后添加函数时,都会创建分页,但所有页面在第1页中都具有相同的分类法
我使用的代码是
<?php get_header(\'category\');?>
<section class="gallery-block compact-gallery">
<div class="container">
<div class="row mx-auto justify-content-center ">
<?php
$term = get_queried_object();
// if($term->post_parent !=0 ){
$term_id = $term->term_id;
$taxonomy_name = $term->taxonomy;
$termchildren = get_term_children( $term_id, $taxonomy_name );
// echo $postcat ;
if ( !empty( $termchildren )){
foreach ($termchildren as $child) {
$term = get_term_by( \'id\', $child, $taxonomy_name );
?>
<div class="col-md-6 col-lg-3 item bg-white mb-5 p-0 mr-2">
<a class="lightbox" href="<?php echo get_term_link( $term, $taxonomy_name );?>">
<img class="img-fluid image w-100 h-50" src=" <?php echo get_theme_file_uri(\'/images/\'.$term->name.\'.png\');?>">
<span class="description">
<span class="description-heading tajawal "><?php echo $term->name ;?></span>
<span class="description-body"></span>
</span>
</a>
</div>
<?php } wpbeginner_numeric_posts_nav(); }else { ?>