Pods Blocks were introduced in Pods 2.8 and will work in the Block Editor for any post type. As of WordPress 5.8+, Pods Blocks can also be used in the Widget Editor.
Contents
Pods Field Value
This block allows you to specify a field to display anywhere you’d like. This is useful because it lets you place it within other blocks that allow InnerBlock support, or for displaying long-form content.
Options
- Pod name
- If you leave this blank, it will use the current pod on the page.
- Slug or ID
- If you leave this blank, it will use the current ID on the singular page.
- Field Name
- This is the field name you want to display.
Pods Single Item
This block allows you to specify an item to display using a Template or Custom Template.
Options
- Pod name
- If you leave this blank, it will use the current pod on the page.
- Slug or ID
- If you leave this blank, it will use the current ID on the singular page.
- Template
- Choose the template you’d like, if you are using previously saved reusable Pods Templates.
- Custom Template
- You can specify a custom template to use, it accepts HTML and magic tags.
Pods Single Item – List Fields
This block allows you to display field labels and field values without writing any HTML or markup.
Options
- Pod name
- If you leave this blank, it will use the current pod on the page.
- Slug or ID
- If you leave this blank, it will use the current ID on the singular page.
- Output Type
- Choose how you want your output HTML to be set up. This allows you flexibility to build and style your output with any CSS customizations you would like. Some output types are naturally laid out better in certain themes. Available options are: Unordered list (
<ul>
), Description list (<dl>
), Paragraph elements (<p>
), Div containers (<div>
), and Table rows (<table>
)
- Choose how you want your output HTML to be set up. This allows you flexibility to build and style your output with any CSS customizations you would like. Some output types are naturally laid out better in certain themes. Available options are: Unordered list (
- Display Fields
- Comma-separated list of the Pod Fields you want to display. Default is to show all. Use this OR the Exclude Fields option.
- Exclude Fields
- Comma-separated list of the Pod Fields you want to exclude from display. Default is to show all. Use this OR the Display Fields option.
Pods Item List
This block allows you to specify a list of items to display using a Template or Custom Template.
Options
- Pod name
- If you leave this blank, it will use the current pod on the page.
- Template
- Choose the template you’d like, if you are using previously saved reusable Pods Templates.
- Custom Template
- You can specify a custom template to use, it accepts HTML and magic tags.
- Content Before List
- This content will appear before the list of templated items. A useful way to use this field is if you have a template that uses
<li>
tags, you can use<ul>
to start an unordered list. This will only be shown if items were found.
- This content will appear before the list of templated items. A useful way to use this field is if you have a template that uses
- Content After List
- This content will appear after the list of templated items. A useful way to use this field is if you have a template that uses
<li>
tags, you can use</ul>
to end an unordered list. This will only be shown if items were found.
- This content will appear after the list of templated items. A useful way to use this field is if you have a template that uses
- Not Found Content
- If there are no items shown, this content will be shown in the block’s place.
- Limit
- Specify the number of items to show but keep in mind that the more items you show the longer it may take for the page to load. You should avoid using “-1” here unless you know what you’re doing. If your pod has many items, it could stop the page from loading and cause errors. Default number of items to show is to show 15 items. See also: find()
- Order By
- You can specify what field to order by here. That could be
t.post_title ASC
or you may want to use a custom field likemy_field.meta_value ASC
. The normal MySQL syntax works here, so you can sort ascending withASC
or descending withDESC
. See also: find()
- You can specify what field to order by here. That could be
- Where
- You can specify what field to restrict the item list by here. That could be
t.post_title LIKE '%repairs%'
or you may want to reference a custom field likemy_field.meta_value = '123'
. For a list of all things available for you to query, follow the find() Notation Options. See also: find()
- You can specify what field to restrict the item list by here. That could be
- Enable Pagination
- Whether to show pagination for the list of items. This will only show if there is more than one page of items found.
- Pagination Location
- The location to show the pagination. Default is to show “After list”. Available options are: Before list, After list, Before and After list.
- Pagination Type
- Choose which kind of pagination to display. Default is to show “Basic links”. Available options are: Basic links, Previous and Next links only, Use an unordered list with paginate_links() native functionality, and Use basic paginate_links() native functionality.
- Enable Filters
- Whether to show filters for the list of items.
- Filter Fields
- Comma-separated list of fields you want to allow filtering by. Default is to just show a text field to search with.
- Custom Filters Label
- The label to show for the filters. Default is “Search”.
- Filters Location
- The location to show the filters. Default is to show “After list”. Available options are: Before list, and After list.
- Cache Mode
- The mode to cache the output with. Default is “Disable Caching”. Available options are: Disable Caching, Object Cache, Transient, or Site Transient.
- Expires
- Set how long to cache the output for in seconds. Default is 300 seconds (5 minutes).
Pods Form
This block allows you to display a form onto the page for submitting new content to any Pod.
Options
- Pod name
- If you leave this blank, it will use the current pod on the page.
- Slug or ID
- If you leave this blank, it will use the current ID on the singular page.
- Field Names (comma-separated)
- Comma-separated list of the Pod Fields you want to include. Default is to show all.
- Submit Button Label
- The label to show in the submit button of the form. Default is “Save Changes”.
- Redirect URL
- After someone submits the form, they can be redirected anywhere you would like. You can reference the saved item ID by using
X_ID_X
in the URL. The default is to not redirect.
- After someone submits the form, they can be redirected anywhere you would like. You can reference the saved item ID by using
- Output Type
- Choose how you want your form HTML to be set up. This allows you flexibility to build and style your forms with any CSS customizations you would like. Some output types are naturally laid out better in certain themes.
Pods View
This block allows you to display a file from your theme or child theme onto the page. This is most useful if you want to embed template files so you can keep those files version controlled.
Options
- File to include from theme
- This is the file location relative to your theme or child theme folder. For example:
my-text.php
orparts/ad-spot.php
- This is the file location relative to your theme or child theme folder. For example:
- Cache Mode
- The mode to cache the output with. Default is “Disable Caching”. Available options are: Disable Caching, Object Cache, Transient, or Site Transient.
- Expires
- Set how long to cache the output for in seconds. Default is 300 seconds (5 minutes).