WordPress.org

Ready to get started?Download WordPress

Forums

register_post_type() and pagination error (4 posts)

  1. lolalola
    Member
    Posted 1 year ago #

    Hi,
    i create new post type with register_post_type() function.

    Get posts by authors:

    $args=array(
    	'showposts' => $showposts,
    	'paged' => $paged,
    	'post_type' => 'cars',
    	'author' =>  $curauth->ID
    );
    
    query_posts($args);

    Everything works well, except last page.

    I have 17 posts, displays 7 in page. And when i click on last (3 page),
    I always get "nothing found" page.
    Even is_author() function don't recognize that is author page.

  2. vjpo
    Member
    Posted 1 year ago #

    Did you define $paged variable? I am not sure, but try this example.
    The 'showposts' parameter is deprecated favor of 'posts_per_page'. So try to change it.

  3. lolalola
    Member
    Posted 1 year ago #

    Hi,
    thanks, but this not work.

  4. keesiemeijer
    moderator
    Posted 1 year ago #

    Can you provide a link to a page demonstrating the problem.

    Can you paste and submit the full code of the theme template file into a pastebin.com and post the link to it here? see the Forum Rules for posting code and using the pastebin.

Topic Closed

This topic has been closed to new replies.

About this Topic