-
Notifications
You must be signed in to change notification settings - Fork 2
Shortcode
Jo Dickson edited this page Jun 8, 2021
·
7 revisions
The UCF-News-Plugin comes with a prebuilt shortcode for displaying news lists within a content block. The options for the shortcode are very similar to those of the widget.
To include a news list with the default options, simply add [ucf-news-feed]
to the content editor of the page or post you'd like the articles listed on.
It is possible to override some of the default settings by adding attributes to the shortcode. For example, if you wanted to list 5 articles instead of the default 3, you would update the limit
attribute:
[ucf-news-feed limit="5"]
All of the attributes available have defaults that will be used if they're not overridden.
Attribute | Description | Default |
---|---|---|
title |
The title that is displayed above the news list | News |
layout |
The layout to use to display the news list* | classic |
sections |
Allows you to filter the results by section (category). Enter one or more comma-separated section slugs. | Blank (Will return articles from all sections) |
topics |
Allows you to filter the results by topic (tag). Enter one or more comma-separated topic slugs. | Blank (Will return articles from all topics) |
search |
Allows you to filter the results by an arbitrary search query. | Blank (Will not perform a search query) |
limit |
The number of articles to display | 3 |
offset |
The number of articles to skip in the feed. For example, set to 1 to skip the first article. | 0 |
per_row |
The number of news items to show per row (only applicable on layouts that support rows/columns) | 3 |
feed_url |
Allows the base URL for the feed to be overidden. | n/a (Uses plugin setting for feed URL) |
show_image |
Whether or not article thumbnails should be displayed (only applicable on layouts that support image display) | true |