Documentation - Getting Started - Case study – Creating sort for a complex front side theme query

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInPrint this page

Case study – Creating sort for a complex front side theme query

Time has changed those days when it come to coding, everything it’s away more complex than before, solutions and technologies had evolved enormous to provide the excellent dynamic that most of current websites enjoy. The Advanced Post Types Order plugin follow the trends and provide the ultimate framework for making sort of WordPress content, through a flexible extensible code. Practically any area on the theme can be re-arranged no matter the complexity of the back driven query.

Consider the following scenario, a custom post type called Portfolio, a custom taxonomy called Portfolio Categories, a custom page template called Portfolio Template.

The Portfolio Template allow the user to select the categories from Portfolio Categories which are going to show on front side:

advanced-post-types-order-case-study-term-select

We select two terms called Jewelry and Jordan King.
At this moment, there is no custom sort applied on Portfolio posts displayed through Portfolio Template, except the default which can be by date, ID etc.

Sort Apply

To create a order list to control this area, first we need to create a sort list. First access the Re-Order interface where you want to include the new sort. Click the + tab which allow to create a new sort:

advanced-post-types-order-interface-new-sort-tab

Chose the Portfolio from post type dropdown. Chose Portfolio Categories from Taxonomy area. Once the list of terms update on the right, chose the very same terms we had previously chose on Portfolio Template, which would be Jewelry and Jordan King. The Taxonomy Operator should be set as IN (depending on template query this may need to be set for AND).

advanced-post-types-order-case-study-settings

After the sort settings save, the Portfolio posts which match the above query will show within the sort list, allowing a manual / automatic order to apply. If the Auto Sort is set On the order will apply automatically on front side for Portfolio Template.