Contents
WCK Swift Templates is available only in WordPress Creation Kit Pro version. It allows you to build your Front End Templates directly from the WordPress Admin UI, without writing any PHP code.
Overview of Swift Templates
In order to create a Swift Template go to WCK -> Swift Templates and click on Add New.
Inside the Swift Template we can set the Swift Template Arguments, Query Arguments and Swift Templates – Archive and Single Template.
Swift Template Arguments
In the Swift Template Arguments tab we can select a Custom Post Type that our Archive and Single Templates will be based on. We can create our own Custom Post Type using WCK Custom Post Type Creator.
Query Arguments
The Query Arguments interface allows you to quickly add some of the Query Arguments that are possible with WP_Query().
Query Arguments:
- Posts Per Page
- Order
- Order By
- Author ID
- Author nicename (not name)
- Category ID
- Category Slug
- Tag ID
- Tag Slug
- Post Parent ID
- Year
- Month
- Week
- Day
- Hour
- Minute
- Second
- Meta Key
- Meta Value
- Meta Value Numeric
- Meta Compare
To see accepted values just click the link “see accepted values” under the drop-down and a lightbox will appear with possible ( Query Arguments / Value ) combinations.
IMPORTANT: After this step make sure to “Publish” your Swift Template so it can generate all the variables needed at the next step.
Swift Templates
WCK Swift Templates allows you to create Archive and Single Templates for your Custom Post Types, Posts or Pages without writing any PHP code. Inside the Templates you can display all the Custom Fields and Custom Taxonomies. Usually the default WordPress Archive and Single Templates only displays the Post Title and Content.
Archive Template
In the Swift Template tab we can start building the Archive Template. In the right side you will see a list of all the available variables.
Single Template
Below the Archive Template we can start building the Single Template. In the right side you will see a list of all the available variables.
Make sure to mark the checkbox below the Single Template Editor to use it on all posts for the selected Custom Post Type.
Note: To properly display the WYSIWYG Editor Field used in the Swift Template, add the variable with 3 curly braces (3 mustaches): {{{ custom_field }}}
Swift Template Shortcode
In order to display the Swift Template we will need to create a page and add the generated shortcode inside.
Display Custom Post Types, Custom Fields and Custom Taxonomies with Swift Templates
After creating your Custom Post Types, Custom Fields and Custom Taxonomies, Swift Templates lets you display them in your current WordPress theme with just a couple of clicks.
With Swift Templates you can:
- Display Custom Fields in WordPress Pages (Posts or Custom Post Types) with no coding
- Create Archive Templates for your Custom Post Types (Pages or Posts)
- Create Single Templates for your Custom Post Types (Pages or Posts)
- Create Taxonomy Archive Templates with no coding
- Create Taxonomy Single Templates with no coding
- Custom Query Arguments
All of this without writing any PHP code or messing with any of the template files.
Swift Templates turns a time consuming and error prone process that was previously only accessible to developers into a straight forward UI that with a little bit of HTML and CSS allows you to develop complex WordPress sites.