Skip to content

Blocks & page builders

Yatra cooperates with WordPress page builders rather than replacing them. Trip content lives as standard custom post types (trip, destination, activity, trip-category), and Yatra ships native Gutenberg blocks plus shortcodes for the most-used catalog components.

Yatra blocks (Gutenberg)

Yatra registers native blocks under the Yatra block category. Each one mirrors the corresponding shortcode and supports inspector controls so you can tweak the look without typing attribute strings.

BlockShowsMirrors shortcode
Yatra TripA trip grid / list with filters[yatra_trip]
Yatra DestinationA destinations grid / list[yatra_destination]
Yatra ActivityAn activities grid / list[yatra_activity]
Yatra Trip CategoryA trip-category grid / list[yatra_trip_category]
Yatra SearchA trip-search form[yatra_search]
Yatra My AccountThe customer-account page[yatra_my_account]

To insert: in the editor, click the + add-block button → search for Yatra.

Trip block — inspector controls

When you select the Yatra Trip block, the right sidebar shows:

  • View — Grid or List.
  • Per page — items per page.
  • Columns — for the grid layout (1–4).
  • Order by — Date, Title, Price, Featured Priority.
  • Order — Ascending / Descending.
  • Featured Priority — None / Featured / Sticky / High-priority. Filters or sorts by the trip's Featured Priority value.
  • Difficulty Level — filter by chosen levels.
  • Destinations / Activities / Categories — multi-select filters.
  • Pagination — show / hide.

Most attributes mirror the shortcode 1:1 — see Shortcodes for the full list.

About backward compatibility: the legacy featured attribute is now an alias for featured_priority="featured". Existing blocks with featured: true auto-migrate to featured_priority: "featured" on first save.

Destination / Activity / Category blocks

Same pattern as the Trip block, but for the corresponding taxonomy. The card UI is the whole card clickable (CSS stretched-link) — clicking anywhere on the card opens the destination / activity / category archive.

Elementor

Free Elementor + Yatra:

  • Shortcode widget — drop in [yatra_trip ...] for a trip grid.
  • Posts widget — set the Source to Posts and Post Type to Trips (trip). You then style cards with Elementor's controls.
  • Loop Grid — works with trip as the source post type.

Elementor Pro users can build full Single Trip templates via the Theme Builder, using the Posts widget for title, content, image, and a Shortcode widget for the Book now CTA.

Divi

  • Code Module for shortcodes.
  • Theme Builder — assign a Divi template to the Trips custom post type.
  • Blog module — set Post Type to trip for a Divi-styled grid.

Beaver Builder, Bricks, Oxygen

  • Use a Posts module / element with the post type set to trip.
  • Use a Shortcode module for the search / account forms.
  • Use Dynamic Data to bind to trip meta (price, duration, difficulty, featured priority) for designer-controlled cards.

Templating override (the universal escape hatch)

Every Yatra template can be overridden by your theme. Yatra looks in wp-content/themes/{your-theme}/yatra/ first and falls back to the plugin defaults.

To customize a trip card:

bash
mkdir -p wp-content/themes/your-theme/yatra/partials
cp wp-content/plugins/yatra/templates/partials/trip-card.php \
   wp-content/themes/your-theme/yatra/partials/trip-card.php

Then edit the copy in your theme. Plugin updates won't overwrite it.

Frequently overridden templates

Path (under templates/)What it renders
single-trip.phpSingle trip page
archive-trip.phpMain /trips/ archive
partials/trip-card.phpTrip card
partials/booking-content.phpThe booking / cart content shell
partials/single-trip/enquiry-modal.phpThe "Make an Enquiry" modal
partials/single-trip/itinerary.phpItinerary tab
my-account.php, booking.phpCustomer-facing virtual pages

Caching, CDN, image plugins

  • Exclude /booking/, /my-account/, /wp-json/yatra/v1/* from full-page caching.
  • Bypass cache for logged-in users on trip pages (so Wishlist heart state is accurate).
  • Lazy-loading images is fine — cards include explicit width/height for CLS.
  • WebP via image plugins (ShortPixel, EWWW) works without changes.

Translation plugins

Yatra's text domain is yatra.

  • Loco Translate — in-WordPress translation editing.
  • WPML — multilingual catalogs (trip content + UI strings).
  • Polylang — register CPTs / taxonomies in Polylang settings.
  • TranslatePress / Weglot / GTranslate — site-wide translation overlays.

SEO plugins

Yoast SEO, Rank Math, and SEOPress all index Yatra trips correctly. Yatra's CPT and templates are SEO-friendly out of the box.

Multisite

Yatra is Network: true. Each subsite gets its own data.

What's next