Created
December 11, 2015 18:24
-
-
Save alenabdula/220bbe8d92f2a0372561 to your computer and use it in GitHub Desktop.
Sets proper headers for RSS Feeds using Timber Library and Twig Templating Engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sets proper headers for RSS Feeds using Timber Library and Twig Templating Engine | |
* Fallbacks: | |
* 1. application/rss+xml, | |
* 2. application/rdf+xml, | |
* 3. application/atom+xml, | |
* 4. application/xml, | |
* 5. text/xml | |
*/ | |
header("Content-Type: application/rss+xml, application/rdf+xml, application/atom+xml, application/xml, text/xml"); | |
# Timber Context | |
$context = Timber::get_context(); | |
# Render View | |
Timber::render('feeds.twig', $context); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment