If you’ve created a Custom Post Type, then WordPress should be able to handle this for you automagically. Check the Template Hierarchy.
Instead of creating a “Page” and trying to paginate that, create archive-{post_type}.php
instead. That file will be used as the index file for your CPT, and will show up automatically at http://yoursite.com/news
.
You’ve made this too complicated, unless there is a lot of information missing from the question.
Related Posts:
- Creating a custom category page with pagination
- How to remove wp_link_pages() from template
- Show all parts in multipage post
- Unable to display pagination links on custom category template
- Get URL of current post but not the page number
- Pagination issue with tag.php
- Give wp link pages it’s own template
- Can index.php take over for front-page.php in template hierarchy on second page?
- Pagination problem (plugin wp-pagenavi) with a custom post type?
- template with multiple post loops for multiple widgets [duplicate]
- Add pagination to blog
- How do I get the size of an attachment file?
- How to get slug of current category in taxonomy template?
- I put my blog on a subpage, how do I get page title?
- Outputting Canonical Resource URLs Across a Multisite Network?
- Restrict a search to a custom post type
- Test if page is child and has children, if so echo child pages also on grandchild pages
- How did you incorporate WooCommerce in your own WordPress theme?
- Correct process for a new Page Template?
- Templates & CSS – Proper Programming Practice?
- Custom Page Template for “Older Posts” Pages
- New Template — copy existing template and change code? [duplicate]
- Same template for all the terms of a taxonomy
- Modifying searchform.php and search.php to have two kinds of searches
- Create a WordPress template without navigation and footer
- Template redirect is_tax() not working
- paginate_links() outputs extra empty pages on custom loop
- Passing variables to template parts
- Show template loaded
- Change directory where get_header(), get_footer() and get_sidebar() look for templates
- How can I make my custom templates respect permissions?
- How to format shortcode’s HTML in external file
- How to replace WordPress sidebars (widget areas) with Gutenberg
- Unable to include a template
- Turning on the 404 page on localhost
- Checking for page templates in child theme
- Is there an action hook that fires just before a template is loaded?
- post edit button on front end
- What’s the equivalent of front-page.php for a custom static page?
- Stylesheet comment header: Which header names are mandatory? [duplicate]
- How to add posts list to a page template?
- Valid HTML in Template Part
- Why do I get the same excerpt for all items in my RSS feed?
- What is this code trying to do? It was the cause of my 20s TTFB
- get_post_metadata() undefined when used in loop in RSS template
- the_excerpt producing empty output
- Problem when linking out to separate file within foreach loop
- Conditional tags or Multiple files
- Getting term description in single post template
- Can I add a default Block to my custom theme?
- Remove post templates from the selection box menu when creating a single post
- How to convert the WordPress meta box Page Attributes->Page Template dropdown to radio buttons?
- Why category.php throw 404 in wordpress while calling paginate_links()?
- global variables in templates
- Real Time Page Template Preview in WP Admin [closed]
- paginate_links() don’t properly work in search.php?
- Best practice to update the file header.php
- page-{slug}.php vs. template-{slug}.php
- Understanding the Template hierarchy
- wp_enqueue_style and different styles for blog template
- Can I have both front-page.php and index.php?
- get_header(), get_footer() from plugin template
- Problem creating a custom category page with pagination
- how can I add a “read more” tag directly in the template?
- Update template without undoing all my edits?
- How to get and set the post tag value within WP Query from URL?
- How to display specific child page template in wordpress
- The wordpress website is showing ‘w’ while it loads and in the footer
- how to properly include or get file contents in a wordpress theme
- Is there a wordpress template like this [closed]
- Assign Specific Template for Custom Post slug
- Including template pages within another template?
- Pagination on WP_User_Query not updating current page
- Why won’t the action hook wp_head accept parameters?
- trouble calling different header.php for home.php
- the_post() in RSS feed
- How Add Code in Page Index Custom Template?
- Editing my loop-page.php causes posts to show on all pages
- How can i conditionally load taxonomy-{taxonomy}.php template php files through functions.php
- Commented code in WordPress template?
- Search button click sends to single-custom_post_type instead staying at the same page
- Display all page which have not a certain template
- How to add post page pagination to template part?
- 404 page not found on pagination in home page while navigating to next page
- Which template(s) to override to use a different sidebar for blog, single posts, categories, blog archive?
- how to insert gravity newsletter subscription form in template
- how to change custom post type search template to output search results in posttype-archive.php
- How can I modify this code to include the parent?
- Locating the template behind a WordPress Page
- WordPress 404 pagination (/page/2) error?
- Is this the best way to complete disable category archive pages?
- Search results in custom template
- Why is my pagination showing up?
- Is there a list of all possible WordPress URL’s?
- How can I setup custom templates for a meta-data query
- Move Index to a page
- Problem with custom page template and permalink
- Index template and Home page
- How to display page content and a list of posts on the same page?
- Force template on page load