The Shortcode that you have to Add is
Note: The maximum no of itineraries that a plugin can display by default is 20. But you can show more no. of trips by passing the limit parameter.
You can add the Shortcode either in page/ post. With the addition of the shortcode, you will be able to view the Itinerary’s in page/post, depending on where you have to use the shortcode.
There is two special feature that you can manage using Shortcode.
- Limit the no of the itinerary to display.
- Display the itinerary according to the type.
Using shortcode you can limit the no of the itinerary to display at the front end.
Using this Shortcode you can limit the no. of the itinerary to 1 i.e you will be able to display only one itinerary at the front end.
Note: The default value of the limit is set to 20.
Basically, there are 3 different types according to which you can display the itinerary.
If you include the featured type in shortcode all the itinerary that is marked as featured is displayed at the front end.
If you include the itinerary_types in the shortcode , you have had to enter the id or the slug of trip Type. Only then the itinerary associated with that trip type will be displayed at the front end.
- [WP_TRAVEL_ITINERARIES type=featured ]
- [WP_TRAVEL_ITINERARIES type=itinerary_types slug="trekking" ]
- If you include the travel_locations in the shortcode , you have had to enter the id or the slug of Locations. Only then the itinerary associated with that location will be displayed at the front end.
- Using ID: [WP_TRAVEL_ITINERARIES type=travel_locations id=92 ]
- Using Slug : [WP_TRAVEL_ITINERARIES type=travel_locations slug="karnali" ]
Note: Not just ID but you can control the display using the Slug attribute. i.e in place of ID, you can place “slug=” name for itinerary_types and travel_locations.
Display the trip type according to the location:
If you wish to display a trip type of a certain location then you can do so by adding the shortcode as given below:
[WP_TRAVEL_ITINERARIES type=travel_locations slug="karnali"]
Display single Trips on post/page.
If you want to display single trips only using the shortcode then you can do so by using the id of the trips.
For eg : You can paste the below-given shortcode :
This shortcode will display the trip with id “8852” only.
Shortcode to display the trips in ascending and descending order.
With the WP Travel version 3.2.1, we have added the shortcode using which you will be able to display the trips in ascending and descending order.
[WP_TRAVEL_ITINERARIES orderby="trip_date" order="desc" ]
[WP_TRAVEL_ITINERARIES orderby="trip_date" order="asc" ]