How to move Feedzy templates to your theme
You may want to move the templates that come with Feedzy to your theme in order to preserve the changes over upgrades.
In order to do this, you need to follow the next steps:
- 1
-
Inside your theme folder, you need to create one called
feedzy_templates
.
- 2
-
Then you need to go to your pro plugin folder and you will find one called
templates
( default.php, style1.php, style2.php ).
- 3
-
After this, you need to copy the files from
templates
to yourfeedzy_templates
theme folder.
You are now ready to go, WordPress will use your new template files inside the ones from the plugin.
💡 Creating Feedzy templates
Let's assume you are using Neve.
- 1
-
Go to your installation's wp-content > themes > neve folder and create feedzy_templates folder.
- 2
-
Copy all the files from your
Feedzy RSS Pro
's folder >
templates.
- 3
- Paste them to neve > feedzy_templates.
Now, WordPress will be using the new template files which are in Neve's folder, and it will preserve the changes over updates.
- 4
- Navigate to the desired page and add the following shortcode, replacing the template's file name:
[feedzy-rss feeds="https://themeisle.com/blog/feed/" template="style1"]
From this point, you can make changes to the template file and just mention it in the shortcode; in this case is "style1.php".
📌 How to extract custom tags?
Go to the file of the template that you are using and use one of the following filters to extract the custom tag value:
- display the category of the feed using bold
<strong> <?php echo 'Category: ' . apply_filters( 'feedzy_parse_custom_tags', '[#item_custom_category]', $item ); ?> </strong>
- retrieve any of the values from the feed
<?php echo 'Category: ' . apply_filters( 'feedzy_parse_custom_tags', '[#item_custom_category]', $item ); ?> <?php echo 'Title: ' . apply_filters( 'feedzy_parse_custom_tags', '[#item_custom_title]', $item ); ?> <?php echo 'Link: ' . apply_filters( 'feedzy_parse_custom_tags', '[#item_custom_link]', $item ); ?> <?php echo 'dc:creator: ' . apply_filters( 'feedzy_parse_custom_tags', '[#item_custom_dc:creator]', $item ); ?> <?php echo 'pubDate: ' . apply_filters( 'feedzy_parse_custom_tags', '[#item_custom_pubDate]', $item ); ?> <?php echo 'slash:comments: ' . apply_filters( 'feedzy_parse_custom_tags', '[#item_custom_slash:comments]', $item ); ?>
📝 Note: Because we are using the $item when parsing the content, the snippets used above work only inside the foreach, which is defined in every template as: <?php foreach ( $feed_items as $item ){ ?>.
📝 Note: Here is a doc that explains how to extract values from custom tags.