WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
when i click page '2', it goes back to home page (1 post)

  1. killerbrain
    Member
    Posted 1 year ago #

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    $siteurl = get_option('siteurl');
    	global $post, $paged;
    	$data = '';
    	$temp = $wp_query;
      	$my_query2= null;
    	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	$my_query2 = new WP_Query( array( 'post_type' => 'portfolio',
    									 'paged' => $paged,
    									 'posts_per_page' => '10',
    								   )
    							);
    	while ( $my_query2->have_posts() ) : $my_query2->the_post();
    		$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
    		$content = excerpt($post->post_content);
    		$data = '
    				<div class="grid_7 ports">
    					<div class="">
    						<img src="'.$image[0].'" style="border:solid 1px #ccc">
    						<p class="port-title">'.$post->post_title.'</p>
    						<p class="port-content">
    						'.$content.'
    
    						<a>ID.'" class="viewmore">view more..</a>
    						</p>
    
    					</div>
    				</div>
    				';
    		echo $data;
    	endwhile;
    	wp_pagenavi( array( 'query' => $my_query2 ) );
    	wp_reset_postdata();

    http://wordpress.org/extend/plugins/wp-pagenavi/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic