Viewing 7 replies - 1 through 7 (of 7 total)
  • bkdimri

    (@bkdimri)

    can you post the php code of your page?

    Thread Starter long0708

    (@long0708)

    @bkdimri: This is the php code of category.php:

    <?php
    	remove_action( 'genesis_loop', 'genesis_do_loop' );
    	add_action( 'genesis_loop', 'gamecat' );
    
    function gamecat(){
    ?>
    	<div class="main-home">
    		<div class="title green no-border">
    		<h1 class="title-h"><?php single_cat_title(); ?></h1>
    		</div>
    		<div class="breadcrumb-wrap">
    		<?php if (function_exists('breadcrumbs')) breadcrumbs(); ?>
    		</div>
    		<div class="list-game">
    		<div class="block1">
    				<?php
    				$game = new WP_Query('showposts=1');
    				if ( have_posts() ) :
    				while($game->have_posts()):$game->the_post();
    							$thumbnail = genesis_get_image(
    								array(
    									'size' => 'img-home',
    									'attr' => array(
    										'alt' => caia_get_image_attr( 'alt' ),
    										'title' => caia_get_image_attr( 'title' ),
    										'class' => 'center'
    									)
    								)
    							);
    							?>
    
    				<div class="list-post-left-1">
    					<?php
    					    printf( '<a href="%s" title="%s">%s</a>', get_permalink(), get_the_title(), $thumbnail );
    					?>
    					<div class="list-post-1-intro">
    					<?php
    						printf( '<a href="%s" title="%s"><h3>%s</h3></a>', get_permalink(), get_the_title(), get_the_title() );
    					?>
    					<div class="div-kk">
    					<?php if(function_exists("kk_star_ratings")) : echo kk_star_ratings(get_the_ID()); endif; ?>
    					</div>
    					</div>
    				</div>
    				<div class="list-post-right-1">
    					<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('ads2') ) : endif; ?>
    				</div>
    
    			<?php endwhile; wp_reset_postdata();?>
    			<?php endif; ?>
    		</div><!--end block1-->
    		<div class="block2">
    				<?php
    							$category = get_category( get_query_var( 'cat' ) );
    							$cat_id = $category->cat_ID;
    							$game2 = new WP_Query(array(
    							'offset' => 1,
    							'cat'  => $cat_id ,
    							));
    				if (have_posts() ):
    				while($game2->have_posts()):$game2->the_post();
    							$thumbnail = genesis_get_image(
    								array(
    									'size' => 'img-home',
    									'attr' => array(
    										'alt' => caia_get_image_attr( 'alt' ),
    										'title' => caia_get_image_attr( 'title' ),
    										'class' => 'center'
    									)
    								)
    							);
    				?>
    				<div class="list-post-left">
    
    					<?php
    					    printf( '<a href="%s" title="%s">%s</a>', get_permalink(), get_the_title(), $thumbnail );
    					?>
    
    					<div class="list-post-intro">
    					<?php
    						printf( '<a href="%s" title="%s"><h3>%s</h3></a>', get_permalink(), get_the_title(), get_the_title() );
    					?>
    					<div class="div-kk0">
    					<span class="icon-view"><?php echo postview_get(get_the_ID()); ?></span>
    					<span class="icon-download"><?php echo postdown_get(get_the_ID()); ?></span>
    					</div>
    					<div class="div-kk">
    					<?php if(function_exists("kk_star_ratings")) : echo kk_star_ratings(get_the_ID()); endif; ?>
    
    					</div>
    					<div class="div-icon-os <?php echo types_render_field( "danh-cho-he-dieu-hanh", array( "separator" => " " ) ); ?>">
    					<span class="icon-adroid"></span>
    					<span class="icon-wp"></span>
    					<span class="icon-ios"></span>
    					</div>
    					</div>
    				</div>
    				<?php endwhile; wp_reset_postdata();?>
    				<?php else : ?>
    				<p class="sorry"><?php _e( 'Xin l?i ch?a có bài vi?t trong chuyên m?c' ); ?></p>
    				<?php endif; ?>
    				<div class="clear"></div>
    				<div class="paging">
    				<div class="navigation">
    					<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
    					<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    					<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    					<?php } ?>
    				</div>
    				</div>
    		</div> <!--end block2-->
    		</div><!--end list game-->
    	</div><!--end mainhome-->
    <?php }

    bkdimri

    (@bkdimri)

    instead of

    <?php
    $game = new WP_Query('showposts=1');
    if ( have_posts() ) :while($game->have_posts()):$game->the_post();

    try this

    <?php
    $currentPage = (get_query_var('paged'))? get_query_var('paged') : 1;
    $args =array(
             'cat' => 5, //enter your category id here
    	'posts_per_page' => 30,
    	'nopaging' => false,
    	'paged' => $currentPage,
    	);
    
    $wp_query = new WP_Query($args);
    if ( $wp_query-> have_posts() ) :while($wp_query->have_posts()):$wp_query->the_post();

    Thread Starter long0708

    (@long0708)

    I will try and let you know some hours later, now is 2:40 A.M in Vietnam.
    Thank you very much!

    Thread Starter long0708

    (@long0708)

    @bkdimri: I tried to do it, but the problem has not been fixed.
    Please help me.
    Thank you,

    bkdimri

    (@bkdimri)

    Check this video on YouTube. See if it helps solve your issue
    <a href=”
    https://youtu.be/xEA2zviCakw”&gt; pagination video

    Thread Starter long0708

    (@long0708)

    My problem has not been fixed.
    Anybody help me please. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Category only show the first page’ is closed to new replies.