How to use Post template feature inside campaign editing ?
This answer also apply for:
- How to add all fetched enclosures or media files in the post content ?
- How to add a Gallery with all images in the post ?
- How to add shortcodes automatically in the fetched post contents ?
Campaign post template allow to modify the content fetched by adding extra information, such as text, images, campaign data, etc. before save it as post content.
We’ ve created our own tags to arrange and print the different values of the variables that we can find inside the header of the feed and inside each feed item.
You can use some tags that will be replaced for its current value. See below the description and examples on how to use each one.
There is also the possibility of using WordPress shortcodes, writing them in the Post Template of the campaign so WordPress will take care of processing and printing its content.
You can use any shortcode here; will be processed by WordPress.
For example, you can add shortcodes to add all fetched enclosures or media files in the post content.
Supported tags
A tag is a piece of text that gets replaced dynamically when the post is created. Currently, these tags are supported:
- {title} The feed item title.
- {content} The feed item content.
- {itemcontent} The feed item description.
- {image} Put the featured image on content.
- {author} The feed item author.
- {authorlink} The feed item author link (If exist).
- {permalink} The feed item permalink.
- {feedurl} The feed URL.
- {feedtitle} The feed title.
- {feeddescription} The description of the feed.
- {feedlogo} The feed’s logo image URL.
- {feedfavicon} The feed’s Favicon URL.
- {campaigntitle} This campaign title
- {campaignid} This campaign ID.
- {item_date} The date of the post item.
- {item_time} The time of the post item.
Examples:
If you want to add a link to the source at the bottom of every post and the author, the post template would look like this:
{content} <a href="{permalink}">Go to Source</a><br /> Author: {author}
{content} will be replaced with the feed item content, {permalink} by the source feed item URL, which makes it a working link and {author} with the original author of the feed item.
[gallery]
it’s a WP shortcode for insert a gallery into the post. You can read more info here.
You can add a gallery with three columns with all thumbnails images clickables at the bottom of every content, but before source link and author name, the post template would look like this:
{content} [gallery link="file" columns="3"] <a href="{permalink}">Go to Source</a><br /> Author: {author}
If you want to display all the media videos or audios in the content you could use
[playlist]
The playlist shortcode implements the functionality of displaying a collection of WordPress audio or video files in a post.
The playlist shortcode has several attributes, which are making it possible to alter its output.
[playlist type="video" style="dark"]
Read more about [playlist] shortcode and its attributes here.
To get best results you could also use external plugins that add new shortcodes to display playlists or different galleries by adding their shortcodes in the post template textarea.
Take a look at this example: https://xlino.com/projects/wordpress-playlist-shortcode-with-external-audio-or-video-files/