Dec 23, 2010 15:10
I want to use the pagination in anoter page - page with new game (from new to older). I made this page by apply this code to index.php    <?php
	if ($_GET['new'] == 1)
	{
		include ( TEMPLATEPATH . '/new.php' );
		exit;
	}
?>   and this function don't fit, I understand it. if it would be the page with tags, I know there is wp function is_tag. But what to do in this case?
Dec 23, 2010 14:59
Hi, Jan. I have one small question about function that you wrote for me function wpse5477_pre_get_posts( &$wp_query )
{
if ( $wp_query->is_category ) {
$wp_query->set( 'post_type', 'game' );
$wp_query->set( 'posts_per_page', 3 );
}
} could you help me one more time?
Dec 20, 2010 15:14
yes, i got it now! thank you, Jan!
Dec 20, 2010 15:12
YEEEAAAH!! I'm so glad that now it's working so perfect, I spend so many time with this pagination. Thank u so much!!!
Dec 20, 2010 15:04
plugin wp-navi (by lester Chan) right calculate the number of pages: i have 12 game and make 2 games for page(it's foe example) and pugin correct display 6 page. Maybe it's because by default in wp it's 10 page per post, that why I clicked on page3 go to 404
Dec 20, 2010 14:53
strange thing
Dec 20, 2010 14:53
Jan, thank you very much! Work perfectly, but only go to page2, click to page3 -> go to main page again
Dec 20, 2010 14:46
Call to undefined method WP_Query::is_category()
Dec 20, 2010 14:41
Sorry, connection is lost
Dec 20, 2010 13:23
and I need time understand your point
Dec 20, 2010 13:19
I mean without my query. Sorry for my dissapearing, but I'm not so good in wp-building
Dec 20, 2010 13:11
I wrote in function.phpadd_action( 'init', 'kreate_post_type' );

function kreate_post_type() {
register_post_type( 'game',
array(
'labels' => array(
'name' => __( 'game' ),
'singular_name' => __( 'game' )
),
'public' => true,
'rewrite' => array('slug' => 'game')
)
);
} and then in category.php make $loop = new WP_Query( array( 'post_type' => 'game', 'posts_per_page' => 10 ) );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
echo '<div class="entry-content">';
the_content();
Dec 20, 2010 12:06
yes, get_post_types return nothing. But I declare the post-type in $args. Why get_post_type don't return it? <?php
if ($cat)
{
$cols = 2;
$rows = 4;
$paged = (('paged')) ? get_query_var('paged') : 1;
$post_per_page = $cols * $rows; // -1 shows all posts
$do_not_show_stickies = 1; // 0 to show stickies

$args = array(
'post_type' => 'game',
'category__in' => array($cat),
'orderby' => 'date',
'order' => 'DESC',
'paged' => $paged,
'posts_per_page' => $post_per_page,
'caller_get_posts' => $do_not_show_stickies
Dec 20, 2010 11:57
I use default from twentyten <h1 class="page-title"><?php
printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' );
?></h1>
<?php
$category_description = category_description('post-type'->'game');
if ( ! empty( $category_description ) )
echo '<div class="archive-meta">' . $category_description . '</div>';

/* Run the loop for the category page to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-category.php and that will be used instead.
Dec 20, 2010 11:13
ok, thanks for help, Jan!
Dec 20, 2010 11:11
ok, I'm trying to use default query for category page right now and keep in touch with in this chat room about this question, if u don't mind.
Dec 20, 2010 11:08
I used this query for all: category, tags, main page
Dec 20, 2010 11:07
I just modify this site. Beforfe me, one fellow wrote the plugin, which adding game with thumb and link to swf in admin, and just told how should to do the query to display games.
Dec 20, 2010 11:02
hm! I'll try a default. I'll need to only add post_type -> game. That's all?
Dec 20, 2010 10:59
yes! you can visit to see for example merry-rainbow.ru/category/…
Dec 20, 2010 10:57
I want to open the page with games by certain category and use the pagination for games from this category.
 

 The Loop

Where humor doesn’t work.
Dec 20, 2010 10:54
@JanFabry ok! thanks!
Dec 20, 2010 10:52
Hi, Jan! Thanks for attention to my qustion about pagination. Could we clear this up right now?
Dec 17, 2010 10:24
Hi!