Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug

Try changing the page’s slug to something else and changing your post type registration to this:

  $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'has_archive' => true,
    'show_ui' => true,
    'rewrite' => array('slug' => 'properties', 'with_front' => false),
    'query_var' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'show_in_nav_menus' => false,
    'menu_position' => 5,
    'supports' => array(
      'title',
      'editor',
      'revisions'
    )
  );

The operative new argument is 'has_archive'. This is new in 3.1, and gives you a /properties/, /properties/page/2, etc. structure by default. Then flush your rewrite rules and see if that fixes it. You may also need to comment out any code you’ve written playing with the query or rewrite rules

Leave a Comment