there is no need to handle the pagination like this:
$paged = get_query_var( 'paged', 1 );
Just put this after the loop:
get_the_posts_pagination(
'mid_size' => 1,
'prev_text' => ' ',
'next_text' => ' ',
'screen_reader_text' => 'A'
)
like this:
if( have_posts() ){
while( have_posts() ){
the_post();?>
the_content();?>
<?php }
echo get_the_posts_pagination(
'mid_size' => 1,
'prev_text' => ' ',
'next_text' => ' ',
'screen_reader_text' => 'A'
);
wp_reset_postdata();
}?>
Related Posts:
- Setting a custom sub-path for blog without using pages?
- Add Content to Page without shortcodes
- Loading custom page template via plugin
- How to quickly switch custom post type singular template?
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Pagination Issue: Custom Post Type In Index
- Create second custom 404 page for selected post type
- is_page_template not working as expected
- Create Template for Custom Post Type same like for Page
- Custom-Posttype & Custom Taxonomy WP_Query
- Filter widget outputs
- Custom post type pages return 404 page?
- How to get the current category with custom posts
- Custom permalink structure for remote content pages
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- A certain theme is forcing it’s singular post layout
- Question on templates
- Custom post type option page template
- Custom post Query and WordPress Post Query Clash
- How can I load Template file from wordpress plugin
- How can I find out what template is my custom post type using?
- Loading a template for a URL pattern
- Custom Homepage As Single Page or Custom Post Type?
- How can I pull information from my loop and divide them seperately?
- Custom post type pagination, single page issue
- Using custom post types within a section of a template
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Custom Post Type Template Based on Page Slug?
- how to pass args for archive.php query?
- using a template for more then 1 page
- How do you get the count of posts in an archive page?
- Mixing regular and custom post types (with meta_query) on home page
- tag.php doesn’t work with tags on a custom post type post?
- Assign single template to multiple custom post types?
- $wp_query->queried_object->ID throws warning: Undefined property
- how to filter by last name for custom post
- Custom taxonomy query for a custom post type
- Use WP_Query object inside a function
- WP_Query search custom posts meta date fields
- Get posts with tag all post types
- Assign Page Template Within A Custom Post Type
- Custom Post Type – Archive page title
- Single page theme
- How do I create new content pages for my Custom Post Type?
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- query order by date on custom type: wrong order
- Query custom post types and a specific page?
- Calculating Bayesian average for custom post type
- WP-Admin edit.php & post.php slowdown after import of 10k users
- After updating a page, all pages on the site used the index.php template
- Using custom page templates with plugin [duplicate]
- WordPress Orderby Numeric Value Not Working
- Plugin templates in which directory
- How to add pagination to wp_query [duplicate]
- Using wordpress template tags within an array
- Include custom post type single template, but respect theme override of template if it exists
- Custom post type not using custom template
- WordPress custom loop filter by meta_key and value with serialize data
- Show one item per category of a custom post type
- Mixing 2 custom post types with posts output in specific pattern
- Why is this query not working? (Standard posts + custom post type)
- First custom field value (out of several) displayed twice after query
- Adding the_content() in custom template email
- Migrating a taxonomy’s tags to the native category
- WP_query – Filter by tax_query and meta_query using multiple select
- Create a list of recent Custom Post Types posts
- Empty search input does not return all posts
- Templates for hierarchical custom post type
- tax_query (if the terms are empty)
- Group by custom field value (start and end times)
- Get posts by category name
- WP_Meta_Query object with conditionals
- Problem while filtering by ‘category_name’
- Create a custom taxonomy template that loops through child categories in term order?
- odd behaviours from template tags
- How to order query results based on if a custom field has been populated, then the order by the date of the post?
- Post template with breadcrumb needs to show page navigated from
- WP_Query get always custom post_type for first
- Custom post type not pulling CSS
- meta query multiple values for the same key
- Custom post types – meta_query: search lesson which starts sooner
- Wp Query sort order from custom MetaBox
- Query posts based on user preferences
- WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered
- How to make a custom search template for custom taxonomy?
- DIVs not showing correctly on CPT?
- How can I use WP_Query argument ‘Like %..%’?
- WordPress custom post type
- Custom post type single display is ommited
- Query child posts on parents single.php?
- Template with Custom Post Type (Custom Tables) does not work
- Custom Post Query Combined with Conditional Tags
- Get all custom_post_type posts + blog posts from one category in a single query
- Customising wordpress search and using $_GET[“s”]
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- How to create custom page templates with default page layout framework?
- Adding custom theme template to custom post type [duplicate]
- How can I show posts with the same tag?
- display related posts based on the PAGE TITLE
- Load posts via AJAX without draft status