The Shortcode
The is the main shortcode that you can use to display the table.
[wprs-datatable]Using the shortcode without parameters will query entries that has type review of Rating, and post type Post, also the table name will be set to “Table Name“. You can override those parameters and even use one or more of the other supported parameters.
Parameters simple use
You can add parameters this way:
[wprs-datatable type="rating" cpt="post" table_name="Table Name"]
- Use type=”rating” to define review type, example: rating, percentage, votes, aggregate (default is: rating).
- Use cpt=”post” to define any custom post type you would like to use in the table (default is: post).
- Use table_name=”Table Name” to define the table name. (default is: Table Name).
More parameters
The DataTables add-on support several parameters that you can use to define the query to list entries based on specific criteria or your own, here is a list of all supported parameters:
- table_name=”Table Name”, define the table name.
- type=”rating”, define review type, example: rating, percentage, votes, aggregate.
- cpt=”post”, define custom post type, example: post, page.
- taxonomy=””, define taxonomy name.
- tax_term=””, define taxonomy terms, example terms=”term1, term2″.
- parent=””, define id of parent page, use to query child pages.
- cat=”1″, define category or categories, example cat=”23, 184, 867″
- num=”10″, define number of entries to display.
- title=”Entry Title”, define the entry title.
- rank=”no”, hide the rank column.
- images=”no”, hide the images column.
- width=”160″, set image width.
- height=”100″, set image height.
- summary=”no”, hide the summary column.
- price=”no”, hide the price column.
- rating=”no”, hide the rating column.
- action=”no”, hide the action buttons column.
- min=”5″, set minimum user reviews count required to display entry. (only for aggregate reviews)
You can use this shortcode once per page, and create unlimited pages with useful data tables about your entries.
Settings Page
DataTables settings page give you control over some side-wide settings for tables generated via the add-on shortcode.
In the DataTables settings page, you can:
- Active the add-on with your active license key to receive automatic upgrades and bug fixes.
- Have control over table display settings, like enable or disable search box, pagination, ordering (sorting) entries, and table info.
- Load add-on styles and scripts site-wide, which is needed in some cases (example: when using shortcode inside Theme files, there is no way for the plugin to know and load required styles and scripts).
- Readers Rating
- Rated 4.3 stars
4.3 / 5 (Reviewers) - Outstanding
- Your Rating