Table of Contents
The [TRIPZZY_TRIPS]
shortcode allows you to display a list of trips on your WordPress site. You can customize its output using various attributes.
Available Attributes #
Below are the available attributes along with their default values:
Attribute | Default Value | Since | Description |
---|---|---|---|
orderby | title | 1.1.6 | Specifies the field by which the trips should be ordered (e.g., title , date ). |
order | asc | 1.1.6 | Defines the order direction (asc for ascending, desc for descending). |
posts_per_page | 3 | 1.1.6 | The number of trips to display per page. |
featured | false | 1.1.6 | Whether to display only featured trips (true or false ). |
trip_destination | 1.1.6 | Filter trips by a specific destination (provide the destination slug). | |
trip_type | 1.1.6 | Filter trips by trip type (provide the trip type slug). | |
view_mode | grid | 1.1.6 | Defines how the trips are displayed (grid or list ). |
Usage Examples #
Example 1: Display Default Trips #
[TRIPZZY_TRIPS]
This will display the latest 3 trips in a grid format, ordered by title in ascending order.
Example 2: Display 6 Trips in List View #
[TRIPZZY_TRIPS posts_per_page="6" view_mode="list"]
This will display 6 trips in a list format.
Example 3: Show Featured Trips Only #
[TRIPZZY_TRIPS featured="true"]
This will show only featured trips.
Example 4: Filter Trips by Destination #
[TRIPZZY_TRIPS trip_destination="europe"]
This will display trips that have “Europe” as their destination.
Notes #
- Ensure that trip destinations and trip types are specified using their slugs.
- The
featured
attribute accepts boolean values (true
orfalse
).
This shortcode is a powerful way to dynamically showcase trips on your website while keeping customization options flexible.