You can use the template tag is_feed() to determine if the current request is for a feed:
if ( is_feed() ) {
// It's a feed!
} else {
// Regular 'ol WordPress
}
Note you’ll need to use the function after the request has been parsed (i.e. on or after the parse_query hook).
Related Posts:
- Difference Between Filter and Action Hooks?
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- How to create an API for my plugin?
- How to store username and password to API in wordpress option DB?
- Is there a limit on making calls to WordPress.org API’s?
- Using filters and actions for plugin API?
- WordPress and multithreading
- permalinks with get variables
- Build dynamic page from cURL (HTML page) response with plugin
- How to override a function call in functions.php?
- wp_enqueue_style built in styles
- Should I ask my Twitter plugin users to create their own Twitter App and API Keys to use my plugin?
- Does WordPress’s HTTP API use any caching?
- Example Dashboard Widget, Cancel not working
- Amending REST API function without deactivate/activate plugin every time changes is made
- Why does wp_remote_post returns an empty body response on certain endpoints?
- Adding custom end points, No error line
- Sending post request with wp_remote_post not working correctly
- woocommerce_checkout_order_processed hook executing function twice
- What to hook into to check a value before a post is published?
- Encoding Method for URLs?
- Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions
- Plugin index page code executes multiple times
- Pass CF7 form data to plugin
- Best way to ping for the API changes in the wordpress?
- Plugin architecture to pull from API & create dynamic content on WP site?
- Lead form that submits to 2 external APIs
- Widget internal hooks and functions
- Allow REST API Endpoint to specific user and hide from public
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Get API auth_token token to renew weekly
- How to query a nested field in wordpress api using _fields param
- call funcution when clicking submit
- Adding Amchart Interface to WordPress API
- How do I make secure API calls from my WordPress plugin?
- Generate Static Page to Show Search Results/Detail for API
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- Add WordPress Meta Box saved form input to WordPress RSS feed [duplicate]
- Hiding WordPress REST endpoints from public viewing using Basic Authentication
- add pagination to wp_remote_get
- Multisite and the JSON REST API: How to?
- How do WordPress plugins work with oAuth2 APIs?
- API WordPress is Limited? Return False
- Tie specific functions to options-update for limiting API requests
- Do you see any problems (mainly security-related) with how I’ve used wp_ajax_* actions?
- Is there a way to tell if a shorcode’s handler is being run before or after the content formatting filter?
- Developing a plugin, ran it through P3 Profiler, shows up slow, but I don’t know why
- add_rewrite_rule not working
- How to check during “pre_get_posts” if WP performing default query for specific custom template?
- How do I query posts and have their related taxonomies returned in the results?
- modify buddpress adminbar only in admin pages
- How to update WordPress Plugins in your own maintance application?
- Programmatically creating posts based on external JSON feed (asynchronously)
- External api call using wordpress
- WordPress getting data from external API
- how to send csv file to other server using wp_remote_post?
- How do I return XML to an API post request
- add_menu_page() with different name for first submenu item
- Hook in wp.media to add a new tab
- What is the difference between the “wp_footer” and “get_footer” actions?
- Can I use the wp media uploader for my own plugin?
- Automatic updates in plugin – not hosted on wordpress repository
- Using a database view = evil incarnate?
- Get post ID from the Create post/page admin interface?
- WordPress custom authentication implementation
- How to duplicate custom menu settings to export to another site
- How to post form in ajax mode and handle it in wordpress
- WordPress restrict plugin file direct access
- How to check active theme is parent or child wordpress
- Use of global variables within plugin [closed]
- Add Additional File Info (jpeg compression & file size) settings to Edit Images Screen
- What is the use of get_option method
- “You do not have sufficient permissions to access this page” upon accessing my newly created plugin page
- Retrieve contents/page names of various pages for use in a plugin
- How do I dynamically render an InnerBlock inside a dynamic block?
- Does WordPress run install/uninstall functions on plugin upgrade?
- How to filter the_content() & include content from template
- ResizableBox with RangeControl not working
- WordPress Custom URL
- Asynchronously render shortcodes in TinyMCE visual editor
- wp_mail() headers multipart/alternative
- How to Move the Comments Bubble to the Right Side of the Toolbar
- Can’t find where to modify attrbitutes
- How to pull user/author profile data in a plugin?
- Add Password Generator on password protected page
- WordPress pages are not published due to External database connection with WPDB class
- How to optimize multiple insert into wordpress database
- How to add custom options for plugin into the add post screen – like yoast seo
- Get coordinates of selected area to use in image maps [closed]
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Conditionally check if page is using template from plugin directory
- plugin css is not being applied to the page
- How to save multiple values in custom post type from front end to back end
- Headers already sent on custom plugin (Export function)
- Insert Data into Database
- wp_enqueue_style don’t register all google fonts
- How to return a blank page
- To remove rendering of menus and header, plugin or theme?
- Making plugin output customizable
- How can I get Intellisense working in Visual Studio Code while editing remote PHP plugin code on a WordPress site via FTP?