Post templates

Since version 7.021, the CyberSEO plugin allows one to define HTML templates for post title, post content and post excerpt. You can use these text boxes to define the layout and contents of the posts, generated by CyberSEO. The following predefined tags are available:

%post_title% – post title;
%post_content% – post content;
%post_excerpt% – post excerpt;
%link% – a link to source;
%post_guid% – post GUID;
%media_description% – post media description (if media attachments are included);
%enclosure_url% – the enclosure URL (if attachment enclosure is included);
%custom_fields[name]% – a custom field value, where name must be replaced with the actual custom field name;
%custom_fields_attr[name][attr]% – a custom field attribute, where name must be replaced by the actual custom field name and attr must be replaced by the XML attribute name;
%media_thumbnail[n]% – a link to the media thumbnail where n is its integer index (if media attachments are included).

E.g. if you want to add some text to every post title (say “Breaking news:”), you should alter the “Post title” template like this:

Breaking news: %post_title%

Here is another example. Let’s say you are going to import a product XML feed which has the following items:

<product_name>the product name here</product_name>
<picture>the product picture URL here</picture>
<price>the product price here</price>

First of all, you have to set the necessary custom fields:


Now define your “Post template” like this:

<image src="%custom_fields[picture]%" />
<p><b>Price:</b> %custom_fields[price]%</p>

That’s all you have to do to import almost anything as posts, pages or any custom data type into WordPress and PHP knowledge is not needed anymore!