Custom Post Type Pagination (Not Working)
-
Hello,
I am having a problem with paginating custom post type
I have a custom post type named “news”
and I have a file, an archive file, name “archive-news.php”
My permalink is set to Post Namehere is the link: https://davaohotelelena.com/dev/news/
when you to that link, it displays all the news, the pagination below seemed to work find, but when you go to the subsequent page, it will use the index.php file as the template, instead of the archive-news.php
I have tried to change the permalink and set it back to post name again, still didn’t work
Below is my code for registering the custom post type
function he_custom_post_types() { // News $labels = array( 'name' => _x( 'Latest News', 'Latest News', 'he_framework' ), 'singular_name' => _x( 'News', 'News', 'he_framework' ), 'menu_name' => __( 'Latest News', 'he_framework' ), 'parent_item_colon' => __( 'Parent News:', 'he_framework' ), 'all_items' => __( 'All News', 'he_framework' ), 'view_item' => __( 'View News', 'he_framework' ), 'add_new_item' => __( 'Add New News', 'he_framework' ), 'add_new' => __( 'New News', 'he_framework' ), 'edit_item' => __( 'Edit News', 'he_framework' ), 'update_item' => __( 'Update News', 'he_framework' ), 'search_items' => __( 'Search News', 'he_framework' ), 'not_found' => __( 'No News found', 'he_framework' ), 'not_found_in_trash' => __( 'No News found in Trash', 'he_framework' ), ); $args = array( 'label' => __( 'Latest News', 'he_framework' ), 'description' => __( 'Latest News Information Pages', 'he_framework' ), 'labels' => $labels, 'supports' => array('title','editor','author','excerpt','comments','revisions','thumbnail'), 'taxonomies' => array(), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'show_in_admin_bar' => true, 'menu_position' => 21, 'menu_icon' => '', 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page' ); register_post_type('news',$args); } // Hook into the 'init' action add_action( 'init', 'he_custom_post_types', 0 );
Thank you in advance for the help
God Speed
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom Post Type Pagination (Not Working)’ is closed to new replies.