Embedding Your View on a Page or Post

Welcome to part #8 of Getting Started With GravityView. In this section of the course, you’ll learn how to embed a View on a page or post.

The GravityView Shortcode

The GravityView shortcode allows you to embed Views on your website. The shortcode accepts several parameters, allowing you to:

  • Filter entries
  • Change the sort direction
  • Only display entries created within a certain timeframe
  • Display entries created by a specific user

… and more!

Embedding a View on a Page or Post

First, edit your View and copy the embed shortcode (you’ll find it on the right, above the Update button).

The GravityView embed shortcode

Next, create a new page or post, click on the ‘+’ icon and select the Shortcode block. 

The WordPress Shortcode block

Now paste the GravityView embed shortcode inside the shortcode block.

The GravityView embed shortcode inside a WordPress Shortcode block

That’s it!

If you’re still using the classic editor…

Simply click on the “Add View” button above the text editor.

The 'Add View' button above the WordPress classic edit

Select the View you want to embed from the dropdown menu and configure the remaining settings below (optional). When you’re done, click “Insert View”.

The 'Select a View' dropdown menu

You’ll see the embed shortcode is now inserted into the editor.

The GravityView embed shortcode inside the WordPress classic editor

WordPress Widgets

GravityView also adds two widgets to WordPress. These widgets are different from those added inside a View. These are WordPress widgets that can be used in the sidebar, footer or any other widget area on your website.

The GravityView Recent Entries widget and the GravityView Search widget

The two widgets are the Recent Entries widget and the Search widget

  1. GravityView Recent Entries Widget
  2. GravityView Search Widget

GravityView Recent Entries Widget

The Recent Entries widget allows you to display entries recently added to a View.

The GravityView Recent Entries widget settings
  1. Widget title
  2. The View where you want to display entries from
  3. The number of recent entries to display
  4. The link text that users can click on to go to the entry
  5. Additional content to show below the entry link

Note: if your View is embedded in a post or page, you’ll need to add the page ID to the input box.

GravityView recent entries

GravityView Search Widget

The GravityView search widgets allows you to search for entries from a specific View from anywhere on your site.

GravityView Search widget settings
  1. The title of the search widget, displayed above the search input boxes
  2. The View that you want to search
  3. If you want users to search entries from an embedded View, you’ll need to add the page ID where the View is embedded
  4. Show the “clear” button, allowing users to clear a search
  5. Choose how you want your search bar to operate. You can set searches to match any field or only one field.
  6. The search input fields
The GravityView Search widget input

Conclusion 

In this lesson, we showed you how to embed a View on a page or post. We also introduced you to GravityView WordPress widgets and how to utilize them on your website.

See you in the next lesson 👋

Additional Resources: