You can try below code for display page with pagination. I set 6 to posts_per_page
which restrict to display 6 post per page at a time.
<?php
//build $args for fetch records...
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
'posts_per_page' => 6,//display post per page
'paged' => $paged,
'cat' => 1
);
//Fetch and loop until records..
$my_query = new WP_Query($args);
while ($my_query->have_posts()):
$my_query->the_post();
$do_not_duplicate = $post->ID;?>
<a href="https://wordpress.stackexchange.com/questions/239816/<?php the_permalink() ?>"><?php the_title(); ?></a></br>
<?php endwhile; ?>
<!--For display links-->
<?php next_posts_link(); ?>
<?php previous_posts_link(); ?>
Related Posts:
- New post status for custom post type
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Adding Custom Post Type Counts to the Dashboard
- WordPress 4.4+ : How to revision CPT + metadata
- How can I filter posts by post_parent in the admin?
- Get Custom Taxonomy ID within loop
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- Using Templates with Custom Post Type UI
- WordPress Custom Post Type Admin Page really slow
- How to setup a Custom Taxonomy Term template
- Creating a gallery of featured images from custom post type
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- wp_list_categories and custom post types
- Bulk 301 redirect for custom post type
- How to add meta boxes(repeater fields) from WordPress back end?
- Custom post type: No posts found even if counter has a count
- ‘category__and’ for custom taxonomy?
- Custom field default value with counter
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Custom post query by taxonomy
- Create second custom 404 page for selected post type
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- Warning when attempting to edit/add custom post type
- Check if a specific custom field exists?
- How does register_post_type know how and which function to use from the add_action function?
- WordPress Create Post from front-end
- Custom post types archive redirect
- Change Featured Image / Thumbnail CMS Description
- Get post from custom post type order by two taxonomies
- add custom field to custom post type
- How to convert custom post type based list to a dropdown list?
- Custom Taxonomy Archives on Custom Post type Page [duplicate]
- Custom post type search using $_SESSION and pre_get_posts
- Display custom fields from custom posts in RSS feed
- On update or create post redirect to current post position in list
- read_post meta capability for anonymous users
- Custom template Page 2 not working
- A custom post within a custom post
- custom post type pagination error 404
- Problems with image size on the server WordPress
- Search by tag name and category
- get_the_title() is returning results from previous loop
- Moving meta boxes in admin
- Can we create a custom post template for a specific page template
- Why is get_pages() returning a boolean?
- Post-thumbnail only for specific post-types?
- Page as Archive page
- 3 random images from custom post type, each in a div with a diffrent class
- get_category_link() for custom post type does not include custom slug rewrite?
- make permalink go to a custom single.php file
- Shortcode leaves no space for other elements?
- Conflict between wp_list_pages and get_posts – list pages not displaying
- How to make a pulldown menu display custom meta terms in a theme?
- Show All Custom Post Types On A Single Archive Page
- Show message when query has no posts
- Get category if used in a custom post type
- Custom Search | check multiple meta_value for search value
- Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis
- Dynamic category name in query post
- Two queries – one with checkbox ticked, one without – comparing meta_query
- Ignores post_type when no results
- Creating on-page options for Custom Post Type
- Check when the post type changes, and display content
- Can I decide what categories show on my posts page?
- How do I call the custom Post Type name and permanent link to my php file?
- Mandatory field in Custom post
- Link custom post type to users membership
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Load info from customposttype into template page
- Multiple Loops In Tabs Only Displaying First Loop
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Display post in sequence from different custom post_type
- Sort loop by custom field from different post type
- Custom post meta box as a sub form
- How to create groups like that in buddypress?
- Custom meta box data not saving
- Custom post type rewrite and wp_pagenavi interfering with each other
- Include template if a post is a single product
- WordPress loop, show only one post per custom field
- Adding Information To All Posts Screen
- Render custom taxonomy query as single template
- Custom meta-box for all custom post types
- Retrieve a specific category of posts when using a custom post type
- General question about Parent and Child Post type relationships
- WordPress Load more posts by ajax not working
- What’s the best way to show custom post types? With page template it’s not perfect!
- Multiple while loops not functioning [closed]
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Ideal top-level slug methods
- How to write an if statement which reads: ‘if is this custom post type or a child of it do the following’?
- taxonomies or categories w/custom post
- Require Custom Taxonomy for Custom Type
- Post count for particular term
- Get post from custom post type that title is like custom string [closed]
- Filter page ID outside the loop and order
- the_post_navigation in single page with multiple taxonomies
- display related posts based on the PAGE TITLE
- Custom Post Types Permalink