In terms of the query, it’s pretty straightforward to do this, but you’ll have to come up with your own interface for creating the order of posts, which should ultimately save the post IDs to an array in the order you want them to appear:
$post_ids = array( 42, 13, 23, 99 );
Then it’s just a matter of getting a “page” of those IDs:
// current page number
$paged = 1;
// number of posts per page
$posts_per_page = 2;
// starting position
$offset = ( $paged - 1 ) * $posts_per_page;
// extract page of IDs
$ids_to_query = array_slice( $post_ids, $offset, $posts_per_page );
Then pass those IDs to the query via post__in, and orderby the post__in array:
$args = array(
'post_type' => array( 'post','secondposttype' ),
'post__in' => $ids_to_query
'orderby' => 'post__in',
'ignore_sticky_posts' => 1,
'posts_per_page' => $posts_per_page
);
$ordered_posts = new WP_Query( $args );
Related Posts:
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Enable comments for post with comments meta box removed
- Custom Post Type causes Page Not Found
- Accessing post’s meta data based on user’s click of a post
- get_post_type on post.php
- Matching Chapters to a Custom posts [closed]
- Redirect to another page using contact form 7? [closed]
- How to delete all trashed item in one-go
- Custom setup of wordpress comments that are displayed
- posts from multiple post types in one slider
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Custom Template for wordpress cpt plugin
- What hook can I use to modify custom post data before it is displayed on the page?
- Is it possible to pin a post in second position from top
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- Adding custom post category to categories widget
- How to display the custom post related blog by category?
- WordPress hide post from custom post-type on a single page
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- WordPress list child pages of custom post type
- Insert data in custom table during new post creation
- How to export post tags from wordpress
- How to check if the post exists in any of the categories?
- Redesigning Custom Post Type “Add New” page
- Jetpack plugin (ShareDaddy): Prevent share buttons showing on custom post types?
- Getting Custom Post Type content from main-site of a Multisite
- Plugin for changing a post’s category based on it’s post date?
- Custom comment type maybe?
- Twillio How To Send SMS for Custom Post Type
- Publish Post After Click On A Link
- Seriously stuck with some custom meta box/plugin stuff
- Edit/revise option for authors to suggest improvement to posts [closed]
- How to Build a Movie Library in WordPress 3.x
- Is there an action that is called when a post is restored from the trash?
- plugin for wp_list_categories with posts
- Replace existing pages with new pages, keep menu links
- Adding “ ” before the last word in multiple defined areas with a plugin
- [Plugin: Posts 2 Posts] How does it work?
- How to add new tabs in post.php
- How to get images from EDD post?
- How to change ID of an attachment in wp_posts and its related tables correctly?
- New post notification plugin [closed]
- Adding Plugin-specific Fields with wp_insert_post()?
- How can i list random post from multiple category?
- Support for simultaneous editing
- dynamically generating plugin syntax
- Duplicate posts when posting nulls in records in phpMyAdmin [closed]
- Exclude post by custom meta with pre_get_posts
- get_post_type() and WP_QUERY issue
- Is there an easy way to flag posts in the admin area?
- List taxonomy terms for post as checkboxes
- finding whether request is for post, and post id
- Custom post type – no layout section of Document tab, and no author choice
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- Display wordpress post’s in popup?
- “Custom Post Type Permalinks” plugin URL strcuture
- Add category selection to custom post type (plugin)
- Custom Post Type Fields
- publish_post action doesn’t work
- Disable Individual Plugins (specifically in Custom Post Types) on a per-post basis?
- custom post type don’t appear in the home page
- wordpress content .php file in an iframe’s src in a wordpress post
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Function added to hook “new_to_publish” not executing – custom plugin
- Creating an admin meta box to save post as pending
- Rename existing cpt and taxonomy with new textdomain
- Can i stream data to a custom_post_type?
- save_post hook partly firing in update post
- Show post object of any page in frontend
- Trying to add a new feature in my wordpress website
- automatically set random featured image by category in wordpress on post
- Page not found after creating the add new post slider using custom post type
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- How can I get the Post ID and Post Type within a Must Use Plugin?
- WordPress Dashboard organize posts based on categories
- Add new post using a page inside the website
- Related posts popup
- Find And Add Category to Posts
- Get page type to display content
- Capturing POST data
- Top Contributors Plugin with Custom Post Type
- featured image problem with custom post type
- Get a submitted value from front end post form for single template
- Automatically set posts to NoIndex depending on category?
- Is an Office a custom post type [closed]
- Notification When Post Approved
- How to hide home title on pages and posts?
- Snippet displaying LearnDash parent course title with lesson title [closed]
- Windows 10 Printer that Sends to WordPress [closed]
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- How to customized post slider layout in elementor wordpress [closed]
- Set the title of a custom post automatically by using info from custom fields?
- public custom posts not showing in my wordpress plugin
- plugin translation *.mo file not getting loaded for custom post
- Create CPT on Ajax Call
- how to compare date meta value in jet smart filter Date query?
- Tickera missing attendees – No attendees found
- How to Display News in a Timeline with Headline, Category, and Time?