WordPress.org

Ready to get started?Download WordPress

Forums

Pagination with categories (3 posts)

  1. Steekvlam
    Member
    Posted 1 year ago #

    Hi,

    I got a problem with the categories.
    The WordPress uses like 60 categories from custom post type, that is alot.
    Now I want to display the categories on the page using a pagination and split it up to 10 categories per page.

    How can I make this possible?

    Greeting,
    Steekvlam

  2. Steekvlam
    Member
    Posted 1 year ago #

    Is this doable with <?php wp_list_categories( $args ); ?>

    This is the html :

    <ul>
    	<li>
    	<aside class="image">
    		<a href="#"><img src="category-image.jpg" alt="" class="imageauto"></a>
    	</aside>
    		<h2><a href="#">Category Title</a></h2>
    		<p>Category description</p>
    	</li>
    <ul>
  3. Steekvlam
    Member
    Posted 1 year ago #

    Im using this one

    <?
                        $posts_per_page = 6;
    
    		    $page = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    		    $offset = ( $page - 1 );
    
    		    $args = array(
    			'order_by' => 'name',
    			'taxonomy' => 'cat_shows'
    		    );
    		    $categories = get_categories( $args );
    
    		    for( $i = $offset * $posts_per_page; $i < ( $offset + 1 ) * $posts_per_page; $i++ ) {
    			$category = $categories[$i];
    			$category_link = get_category_link( $category->term_id );
    ?>

    But it isnt giving me the good pagination.
    Please help?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.