Here’s what I do to keep my RSS Templates together though depending on your version of PHP this may not work but it’s pretty clean. You can add multiple feeds here.
/** Register Our RSS Feeds **/
function my_rss_templates() {
add_feed( 'feedname2', function(){
get_template_part('rss', 'feedname2'');
});
// Rinse and Repeat...
}
add_action( 'after_setup_theme', 'my_rss_templates' );
PHP has a name for the above method, (calling a function like that) but off the top of my head I can’t put a name to it.
Anonymous Function Call – Only available in PHP 5.3 and up.
Related Posts:
- Advantages and disadvantages of using automatic-feed-links
- Add a Post Thumbnail to an RSS Feed with custom size
- Remove tag on my RSS Feed
- custom rss templete
- Run wp_kses_decode_entities on atom feed?
- Access category within rss2_head hook?
- Use a filter for wp_robots to block CPT/feed/
- Disable every rss feed except home feed
- How to check if a user exists by a given id
- Redeclare a function in a child theme
- TinyMCE custom styles remove class when switching styles
- Add admin bar link to edit author
- Extending the site search to include a single custom field
- How to include one class/instance without using global variables
- Modify search function in WordPress (TwentyTwelve)
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- syntax for remove_filter in parent theme with class
- Remove Header and Footer in iframe
- How to Acheive the custom woocommerce category template
- Can I remove the Rich Text box editor for a specific post?
- How to add CSS style sheet dynamically in wordpress
- How to update BuddyPress xprofile fields programmatically? [closed]
- Redirect if not logged in?
- A snippet after every image
- Programmatically set page template based on page ID
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- wp_remote_post with ssl:// protocol
- Best way to programatically add “rel” attributes to page and post images
- Remove function or filter
- options.php problem – data not saved
- Get the category name outside of the loop in category.php
- auto generate title of custom post type which concludes id not working
- Multiple CSS body classes to specific page I.D.’s – is this possible?
- wp_validate_logged_in_cookie
- How does this function get the id of the most recent post?
- Short_title character problem
- Simple custom theme option not being saved
- Unset Category if other Category is unset during post transition
- Automatically wrap multiple images in div
- Ajax not working properly
- Assigning WP functions which echo to PHP variables
- How to add ‘data-caption’ inside an anchor tag
- How can I get my Script to work on the Login page?
- WordPress menu link doesn’t work properly
- Search filter by Post title OR Meta Title Value [duplicate]
- Add custom function to a theme with child theme’s functions.php
- Filtering out the #more anchor link that gets produced by
- Does code run faster in functions.php than in different theme templates?
- file_get_contents – failed to open stream
- Exclude from the query posts with meta_key and meta_value
- wp_nonce_field is breaking form for reasons unknown
- How do I call a function to use on a page?
- replace text in Sort Box
- login_headertitle is deprecated since version 5.2.0
- Where is this JQuery coming from?
- Different favicon on different pages
- Javascript not loading after the document ready
- Need to convert image url to a Base_64 data url with wordpress function..
- What is the better for call files: bloginfo() or echo esc_url()?
- WordPress website keeps loading the maintenance page
- Setting Permalinks in wp_config or functions file?
- How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
- Modify shortcode to work with custom post types
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- How to place a div inside a function that creates a div
- Echo post title in post
- dynamic enquiry form [closed]
- Fatal error: allowed memory size when after using enqueue_script
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- How to redirect Subscribers on login to specific page, when logging in from a Page
- how can I add filter in specfic field in my website?
- Which filter fires upon setting a featured image
- functions.php pharse error on complete new install
- If has action not working as expected
- Update wp_postmeta table based on 2 keys
- Best practice to call a function from a button-link?
- Stylesheet does not load despite functions.php
- How to customize archive widget only for cpt?
- Shortcode to output category description by passing ID
- some profile informations like youtube link doesnt seem
- Help using ShortCodes to style whole chunks of the post
- How to modify or override a core function (wp_star_rating)
- Is there is a way to check daily first login?
- Printing medium sized image
- Filter posts on new page
- Sticky – Featured Image
- Pagination not working on my archive page for a custom post type
- WordPress Jquery+scripts enqueue issue
- Adding a jQuery rotator function
- How to pass a variable from a template page to the child theme functions.php
- Home/Static Page View for Visitors pages after that should be restricted
- functions.php filters not applied in AJAX call
- Settings in functions.php used by a plugin
- Make WordPress search for only this tags or exclude certain tags from search [duplicate]
- Can’t change excerpt length and more tag
- Adding result from PHP function into an input field
- Echo a div to header.php from functions.php
- Changed functions.php file and now site is blank [closed]
- PHP error in shortcode [closed]
- How do i set global variable in a function in wordpress functions.php