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)
- Calling a function via a shortcode in javascript
- How to make this shortcode not refresh the whole page when i use it on frontend
- Placing raw HTML inside a WordPress shortcode
- How do I add text in a shortcode?
- How to Insert Shortcodes into Theme?
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- How can I get content inside one shortcode to another shortcode?
- How to make custom total price reactive in navigation
- Adding tawk.to code just before body tag on functions.php file
- Template part inside shortcode, unexpected reult
- How do I fetch all comments per post via WP REST API?
- Deregistering a script in WordPress seems impossible
- Slide in Panel WordPress Post
- Shortcode Inside Class Not Working
- custom shortcode will not display the wrapped content
- Sending jsPDF documents to the server
- Shortcode content output but not in correct place
- How to prevent those PHP variables from being cached on WordPress?
- is_page “range” for if statement?
- Ajax return code 400
- How can I generate random numbers inside my shortcodes on each implementation?
- How can I add an alert (like the old javascript alerts) to my WP page?
- Pass PHP variable to JavaScript without inline JS
- Show post in slider
- How can I output a php value into a JS file within WordPress?
- PHP code inside shortcodes
- Use WP_Query in shortcode
- Shortcode API: How to get name that matched shortcode RegEx?
- Using shipped version of jquery
- WordPress with php 5.5 and zend opcache
- Putting PHP variables into javascript [duplicate]
- Bridging TinyMCE js and WordPress PHP?
- Shortcode content filter?
- Trying to implement Ajax comments in WordPress, getting WP error
- How to test nonce with AJAX – Plugin development
- Create shortcodes within foreach loop (using array)
- How do I display a user’s previous orders as a select box option on a product?
- Simple Plugin with custom javascript wont work – no console error
- How does this WordPress Plugin (Thrive Comments) apply their custom comment sort? [closed]
- How can I use a modal window to display the current post in loops featured image?
- js file in root loading without
- class click counter save number
- Custom Theme, Custom shortcode not working
- Slider loading issue
- Append HTML Using Shortcode
- AJAX request status 200 but no actual “response”
- Button not refreshing page
- Ajax not working es expected (Returns 0)
- Why is file_get_contents returning page source?
- Plugin CSS not enqueing
- Use menu link or onClick to set a variable
- How to select the contents in the text view textrea in wp_editor?
- Creating a Multi-Level Associative Object Using AJAX
- Different loop output every x posts in custom post type
- WP functions in .js
- Adding custom directory and PHP files in wordpress
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- Ajax – Call to undefined function get_option()
- How to enable Zend Optimiser+ with Batcache
- Dynamic Stylesheet loads but doesn’t finish
- Showing a different gallery in a seperate post
- How to display posts by current user in a drop down
- Create own WordPress shortcode gallery
- How to combine wordpress_logged_in cookies in one cookie?
- Populate dropdown with Child Pages based on Parent Page chosen
- remove wp floating submenu in wp dashboard
- Get value from shortcode to do something
- Displaying admin notices inside the block editor from rest_after_insert_{$this->post_type} hook
- search and replace preword from author
- How to prevent XSS alter custom global javascript object & methods in WordPress
- How to exclude category ID from Looper in WordPress
- How to complete two other input fields, completed the first
- Add a specific part of current category page url to shortcode
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- Status 400 for AJAX POST Request with admin-ajax.php
- How to inject variables into public-facing JS using wp_enqueue_script
- How to pass aa JS variable to PHP?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- Ajax random number always the same
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- JS file work only in index page
- Need Help Fixing My Iframes [closed]
- wp_enqueue_scripts leads to error