While WordPress allows you to make your posts sticky, or even sort them in ascending or descending order, sometimes this is just not enough. What if you want to display the posts in ANY order you need? Unfortunately there is no such functionality in WordPress, which is where this plugin saves the day.
This plugin works on sections of posts, which you can define based on the following three criteria:
- Select posts individually : You can use the drag-and-drop feature to rearrange posts in ANY order.
- Select a category : You can also select posts from any category and change the posts order.
- Show XML/RSS Feed : Here you just need to give the URL of XML Feed and it will fetch latest feed/posts.
You can display ordered posts in theme with query_posts or get_posts or WP_Query like this :
Here NAME_OF_SECTION must be replaced with your actual section name. If no section found with mentioned name then nothing will change.
Once the sections are created, you can display these posts using widgets.
- If you are using custom template option in widget then template file should be placed in
custom-templatesfolder of your plugin (
/wp-content/plugins/my-posts-order/includes/custom-templates/loop.php) and (
Now wasn’t that easy!
Ảnh màn hình
- Upload the
my-posts-orderfolder to the
- Activate the Plugin through the ‘Plugins’ menu in WordPress.
- Go to
My Posts Order Options.
- Create new Sections based on different criteria.
- Go to the Appearance -> Widgets.
- Drag and Drop
My Posts OrderWidget in the Widget Area.
- Select the section name.
- In the same way you can add multiple widgets.
- If you want to display ordered posts somewhere else in a theme, then use it like this
- How can I use custom template option in widget?
You need to create loop.php file in your custom-templates folder. For eg.
- have_posts()) : $the_query->the_post(); ?>
<a href="” title=””>
For for rss option create another file loop_rss.php
- <a target="_blank" href="get_permalink();?>”>get_title(); ?>
- Can you show us some examples how can we add code in our themes?
I’m giving three examples from Twenty Twelve, Twenty Eleven and Twenty Ten
In Twenty Twelve(verison 1.1) you need to edit your index.php file like this
get_header(); ?> <div id="primary" class="site-content"> <div id="content" role="main"> <?php query_posts('section_name=lipsum'); ?> <?php if ( have_posts() ) : ?>
In Twenty Eleven(verison 1.5) you need to edit your index.php file like this
<div id="primary"> <div id="content" role="main"> <?php query_posts('section_name=lipsum'); ?> <?php if ( have_posts() ) : ?>
In Twenty Ten(verison 1.5) you need to edit your loop.php file like this
Here lipsum is the section name that I created in the backend.
Please send me your suggestions/feedback/queries to email@example.com and help me to improve this Plugin.
There are no reviews for this plugin.
Người đóng góp & Lập trình viên
“My Post Order” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.Những người đóng góp
Nhật ký thay đổi
- Made it compatible with WordPress 3.5.
- Bug Fixing.
- Added an option through which we can display ordered posts anywhere in a theme.
- In widget, we can display posts as a drop down or we can use custom template.
- Increased default posts limit to 300.
- Fixed a search related issue.
- Provision to sort pages, category posts, custom post type.
- UI changes.
- Added prefix in front of functions name.
- Added ‘Settings’ link while activating plugin.
- Bug Fixing.
- Added previously created sections on home page.
- Fixed a bug that was causing issue on some servers.
- Bug Fixing.
- Removed Notices and Warnings.
- Initial release