Results 1 to 4 of 4

Thread: Error : Custom stores list page with page navigation !!

  1. #1
    Thread Starter
    Expired Customer namsonceo's Avatar
    Join Date
    Jan 2019
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error : Custom stores list page with page navigation !!

    I had customized my stores page template. I want show list 8 stores per page and use page navigation for next list store.
    But i get error when on permalink /page/2 i get 404 - Not Found.
    With link : https://salesale.vn/nha-phan-phoi/ ( WORK with 8 stores in first page )
    Next page: https://salesale.vn/nha-phan-phoi/page/2 ( NOT FOUND ).
    Here is my code in function.php. I'll echo clpr_store_list_page($args) in stores template.
    Check my website: https://salesale.vn/nha-phan-phoi/
    Code:
    function custom_page_navi( $totalpages, $page, $end_size, $mid_size )
    {
        $bignum = 999999999;
    
        if ( $totalpages <= 1 || $page > $totalpages ) return;
    
        return paginate_links( array(
            'base'          => str_replace( $bignum, '%#%', esc_url( get_pagenum_link( $bignum ) ) ),
            'format'        => '?paged=%#%',
            'current'       => max( 1, $page ),
            'total'         => $totalpages,
            'end_size'      => $end_size,
            'mid_size'      => $mid_size
        ) );
    }
    
    function clpr_store_list_page( $args = array()  ) {
    
    		$taxonomy = APP_TAX_STORE;
    		$number   = 8;
    	    // Setup:
    		$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    		$offset       = ( $paged > 0 ) ?  $number * ( $paged - 1 ) : 1;
    		$totalterms   = wp_count_terms( $taxonomy, array( 'hide_empty' => false ) ); 
    		$totalpages   = ceil( $totalterms / $number );
        // Get the top categories that belong to the provided taxonomy (the ones without parent)
    	 $defaults = array(
    		'taxonomy' => 'category',
    		'menu'     => true,
    		'count'    => true,
    		'top_link' => true,
    		'include' => array(),
    		'class'    => 'terms',
    
    	);
    	$options = wp_parse_args( (array) $args, $defaults );
    	$options = apply_filters( 'clpr_terms_list_args', $options );
        $stores = get_terms( $options['taxonomy'],
            array(
                'parent'     => 0, // <-- No Parent
                'orderby'    => 'title',
                'hide_empty' => false,
                'number'=>$number,
                'offset' => $offset,
            )
        );
    
            // Iterate through all stores to display each individual category
            foreach ( $stores as $store ) {
            	$list = '';         
                $store_id   = $store->term_id;
                $store_name = $store->name;
                $store_img = clpr_get_store_image_url( $store->term_id, 'term_id', 250 );
                $list .= '<div class="store-items">';
                $list .= '<a href="'.get_term_link( $store, $taxonomy ).'">';
                $list .= html('img class="store-img" src="'.$store_img.'"alt="logo"');
                $list .= '</a>';
                $list .= html('a href="'.get_term_link( $store, $taxonomy ).'"',$store_name);
                $list .='</div>';
                 echo $list;
            }
            echo custom_page_navi($totalpages,$paged,1,3);
    
    }

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    41,010
    Thanks
    170
    Thanked 3,409 Times in 3,280 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  3. #3
    ishmamjt's Avatar
    Join Date
    Apr 2013
    Posts
    126
    Thanks
    13
    Thanked 5 Times in 4 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Thread Starter
    Expired Customer namsonceo's Avatar
    Join Date
    Jan 2019
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to show only the stores that have coupons in my stores page
    By dkornsin in forum Help Using Clipper
    Replies: 3
    Last Post: November 6th, 2018, 10:58 AM
  2. [SOLVED] Error page navigation on homepage
    By duclong86 in forum Simplux
    Replies: 4
    Last Post: July 10th, 2014, 09:33 AM
  3. How to fix feed error for coupons and stores page?
    By gangadhar98 in forum Clipper General Discussion
    Replies: 1
    Last Post: November 11th, 2013, 10:57 PM
  4. Home page ads list navigation
    By jmarshall in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: September 27th, 2012, 09:25 AM
  5. [MOD NEEDED] show list of ads from query of custom field in a tab on home page
    By iamfabian in forum ClassiPress General Discussion
    Replies: 2
    Last Post: January 15th, 2011, 10:42 PM