• my pagination of custom page is not working properly: when i click on number of page it take this type of url: https://couponshq.com.au/blog/page/2/
    and page have showing ” ERROR 404 – PAGE NOT FOUND ”

    my code is:

    <?php
    	global $wp_query;
    	                if (!$paged) {
    	                    $paged = 1;
    	                }
    	                $pagenum = $paged;
    	                $per_page = 3;
    
    query_posts(array('post_type' => 'nme_blog', 'posts_per_page' => $per_page, 'paged' => $paged));
    
    	if (have_posts ()) : while (have_posts ()) : the_post();
                            $post_id = get_the_ID();
                            $post_image_id = get_post_thumbnail_id($post_id);
                            $nme_content = get_the_content($post_id);
                            $cat = array();
                            foreach ((get_the_category()) as $category) {
                                $cat[] = $category;
                            }
    
                            if ($post_image_id) {
                                $thumbnail = wp_get_attachment_image_src($post_image_id, array(150, 100), false);
    
                                if ($thumbnail) {
                                    (string) $thumbnail = $thumbnail[0];
                                    $image_src = $thumbnail;
                                }
                            }
    ?>
    
    <div class="blog-post">
    	<div class="list-product">
    
        	<div class="list-product-img"><a>"><img src="<?php echo $image_src ?>" /></a></div>
        	<div class="post-data">
    	    	<div class="list-product-title">
    	        	<h2><a>"><?php the_title(); ?></a></h2>
    	    	</div>
    
    	        <div class="metadata">
    
    <ul>
    			        <li class="date"><time datetime="<?php the_time('c'); ?>" pubdate><?php the_time('F jS, Y'); ?></time>
    			        <li class="author"><?php the_author() ?>
    			        <li class="category"><?php the_category(', ') ?>
    			        <li class="comments"><?php comments_popup_link(__('No Comments', 'eneaa'), __('1 Comment', 'eneaa'), __('% Comments', 'eneaa')); ?>
    			    </ul>
    	    		<div class="clear"></div>
    			</div><!-- /metadata -->
    
      			<div class="list-product-content">
    				<?php the_excerpt(); ?>
           				<div class="read-more"><a>"> Read More</a></div>
                </div>
    
    		    <div class="social-icons" style="display:none;">
    		        <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    		        	<a></a>
    		        	<a></a>
    		        	<a></a>
    		    	</div>
    		    </div>
    		</div>
        </div>
    </div>
    
    <?php
        endwhile;
     endif;?>
    
    <!-- pagination section -->
    <div class="nme-blog-page-navi">
      <?php
        if(function_exists('wp_pagenavi')){
            wp_pagenavi();
        }else{
            $page_links = paginate_links(array(
    								            'base' => add_query_arg('paged', '%#%'),
    								            'format' => '',
    
    								            'prev_text' => __('?'),
    								            'next_text' => __('?'),
    								            'total' => $wp_query->max_num_pages,
    								            'current' => $pagenum
    
    								                ));
    	echo $page_links;
    
        }
    
      ?> 
    
    </div>

    [Please post code or markup between backticks or use the code button. Or better still – use a pastebin. Your posted code has now been permanently damaged/corrupted by the forum’s parser.]

    anyone help me ? Thanks

  • The topic ‘pagination’ is closed to new replies.