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
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- How can I make it so the Add New Post page has Visibility set to Private by default?
- Use a plugin to handle custom post types?
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- How to work with Syntax Highlighter Evolved?
- User-Specific Timezones? Hack? Plugin?
- jQuery plugin only in one page/post
- Auto-post to multiple sites like Posterous? [closed]
- Share buttons on article footer
- How to create a Page alias in WordPress
- Register Custom Post Type from Plugin
- Updating post meta for custom post types
- How to extract images of post and pages excluding header and logo image in wordpress?
- Dynamic HTML not displaying at respective place
- Is there a plugin to display certain posts on certain pages? [closed]
- How to filter content post only on save
- Is there plugin to show recent posts from one website in the widget area of another?
- How use %like% in sql statement wordpress
- How does WP handle multiple matching rewrite rules?
- Saving Custom Post types and fields to a custom table
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- Correct way to make meta box with more than one meta field secure
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- more types plugin – display all post of post type on page
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- auto populate list of questions if user select a category xyz
- “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
- Article content navigator in wordpress like mbaskool website
- Getting a list of the published posts
- Rename existing cpt and taxonomy with new textdomain
- Remove custom taxonomy name from the slug – Custom Post Type UI
- New posts are not showing up on my front page
- Can i stream data to a custom_post_type?
- save_post hook partly firing in update post
- custom post type get_posts() function not work
- Show post object of any page in frontend
- Trying to add a new feature in my wordpress website
- Cannot view Custom Post Type no matter what I try
- Powerpress upload a podcast without creating a post for it
- 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?
- Get value from an input field and pass into update_meta_data as $meta_value
- WordPress Dashboard organize posts based on categories
- Add new post using a page inside the website
- How to display single arbitrary facebook post with a shortcode?
- Related posts popup
- How to Batch Upload .docx Files as Posts
- Find And Add Category to Posts
- Get page type to display content
- Capturing POST data
- Top Contributors Plugin with Custom Post Type
- How can i do custom author list?
- 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]
- Links not opening as they should. Custom WP plugin
- Getting 400 Error in wordpress website
- How to provide page_template path in custom plugin using WordPress