I have added my own custom post type continent
using register_post_type and have created the template single-continent.php. The page is accessed via /moving-to/continent-name.
register_post_type('continent',
array(
'capability_type' => 'post',
'edit_item' => __('Edit Continent'),
'has_archive' => false,
'labels' => array(
'add_new_item' => __('Add new Continent'),
'edit_item' => __('Edit Continent'),
'name' => __('Continents'),
'singular_name' => __('Continent')
),
'menu_icon' => 'dashicons-location-alt',
'public' => true,
'rewrite' => array('slug' => 'moving-to'),
'show_in_nav_menus' => true,
'supports' => array('editor', 'thumbnail', 'title')
)
);
Regular posts can reference this continent (using the ACF Pro plugin) and I am pulling these posts into the page using a second WP_Query loop. All working fine so far.
My problem is that I cannot get pagination to work. I would like to be able to use /moving-to/continent-name/page/2 to display more posts. I am checking for get_query_var('paged')
but cannot seem to call the URL using /page/2 or ?paged=2.