You’d want to look up transients
Here’s a simple example of how you do it.
function showPosts (){
$posts = get_transient ("my_rss_transient");
If (!$posts){$posts=getPosts ();}
/* do showing off stuff here */
}
function getPosts (){
$posts = /* get posts here*/
Set_transient ("my_rss_transient", $posts, MONTH_IN_SECONDS);
return $posts
}
The transient should be saved for each month.
Sorry for the bad formatting.
EDIT: I agree with mark in the comments. Look up his way of doing it rather than this.
Related Posts:
- Run shortcode at certain resolution
- Trigger popup in a php if/else statement
- Passing UTM Parameters To Modify Page In WordPress
- Creating own shortcode – echoeing php variable based on JS variable
- Is the wp_enqueue method efficient?
- Calling PHP Titles inside Javascript Markup
- using shortcodes inside gravity forms
- How do I disable cache for a certain page?
- How to output values from a loop into a javascript array
- Replacing entire tag with shortcode – JavaScript [duplicate]
- How can i iterate through this shortcode array?
- Set variable in javascript and using in my shortcode
- Is there a better way to output HTML as a shortcode?
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- WordPress Infinite Scroll without using any plugin
- Create Image Uploader for Widget
- WordPress Ajax always returns a 404 error
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- How to resize image on client-side before upload?
- Limit the Excerpt field in WP-Admin in words
- How to return a string that has a variable inside in a shortcode?
- Passing a shortcode attribute to a sub-function
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Customizer Show/Hide Logo and Site Title
- Use different javascript files for each page on website
- Create custom blocks for bootstrap
- Click loads template via ajax
- Sending jsPDF documents to the server
- is_page “range” for if statement?
- How can I generate random numbers inside my shortcodes on each implementation?
- js file in root loading without
- Use menu link or onClick to set a variable
- Different loop output every x posts in custom post type
- Showing a different gallery in a seperate post
- Displaying admin notices inside the block editor from rest_after_insert_{$this->post_type} hook
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- wordpress visual composer change grid builder post link
- PHP array to JS array to use in google map
- Displaying recent posts on static page with template-part via shortcode
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Fancybox type popup window that’s not an iframe
- how to make my website secured
- How to correctly add Javascript to this PHP ‘Page Not Found’ Page?
- List taxonomy term slugs within shortcode (do_shortcode)
- get taxonomy thumbnail and use it as a variable in code
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- element not working in Safari [closed]
- Is it save to use eval for a jQuery callback method coming from the database?
- Get html data with javascript to php array and store to wordpress database
- An audio player that showcase a random song from playlist every 24h [closed]
- How to Change CSS Colors from Custom Plugin Settings Page
- Passing the name of selected color from the custom component to `render_callback`
- WordPress transient not working with WP Engine
- How to allow download url redirection only if user logged in WordPress site?
- Shortcode to pull posts
- wp_localize_script() and JavaScript namespaces
- Help Fallback (thumbnail)
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- How can I get my Media Uploader Button to function on 1 click rather than requiring 2 clicks?
- Change Spaces to Dashes?
- WordPress – Get Posts with Category data
- How to use wp_send_json() and output the value with ajax?
- Updating Metadata with Shortcode
- How to store checkbox data for individual users?
- How to Create custom block for displaying information in content section which act like shortcode
- Gutenberg block don’t save rich text content
- Creating a POP Alert
- Hide Approved status for certain users in users list
- ACF values to Script with auto refresh
- How to use Contact Form 7 shortcode value in a page?
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- wordpress dependent dropdownlist using post type is not working
- How to echo a PHP code into WooCommerce variation product?
- Show products per shortcode
- Custom Post type Ajax search results
- include javascript Multiple files in wordpress through script.js
- Ajax wordpress function showing source code in alert and not value of input field?
- Caching of combined CSS and JS fails because of losing MIME types through combining by PHP
- Full search and replace isn’t enough to make all pictures to be loaded with https
- How save data on user’s client cache
- I want url from a file in media using title file
- make an array in wordpress cusmization api?
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- How to create a radio button to alt between settings in wp_options table
- customizer live preview layout picker
- I need help implement a Javascript code into the PHP file
- Formatting Shortcode to Display in Visual Mode
- How to pass parameter that ends up being part of a class name with wordpress shortcode
- Admin bar nodes
- How can I correctly POST to a WordPress page?
- Overwriting a Shortcode
- if is_home(), change class of menu-item-225 of wp_nav_menu
- Load php function with AJAX on modal window
- A next page function with shortcode?
- using a shortcode in a hyperlink
- JSON Object Value Show Undefine
- Display total count of products in orders of a specific order status
- How can I use AJAX in child theme template?