If you have followed the code of the recent page widget then what you are trying to achieve can’t be done as naively as you are trying to do it. Recent posts widget caching is based on the assumption that the same output is displayed everywhere which is why it can calculate the cache on any page and use it on any other page, but this assumption do not apply to your case as you want different output on some pages.
The easiest way to go around it is to have a different cache key for each post like recent-posts-{post id}.
Related Posts:
- WP_query parameters for date range
- insert data in database table from plugin with WP3.1
- Can I ignore caching of a plugin in W3 Total Cache? [closed]
- Comparisson between date() and a date from wp_postmeta
- Find out if request is for custom post type archive before query runs
- How to extract images of post and pages excluding header and logo image in wordpress?
- How to count number of records found in a database table?
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- Advanced Custom Fields query
- Error Message from W3 Total Cache when .htaccess Rules Cannot Be Modified? [closed]
- Can I run multiple queries with $wpdb->prepare?
- Plugin Expires Headers – W3 Total Cache [closed]
- How use %like% in sql statement wordpress
- Accessing GET variable named ‘error’
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- WP_Query ordering numbers as letters
- FacetWP group listings by custom field [closed]
- WooCommerce shop page orderby [closed]
- With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
- Not getting author rank when using return
- How do I “get the next 10 posts after post_id == x”?
- W3 Total cache “empty all caches” and no stylesheets render [closed]
- AJAX search posts and pages
- Getting WPTouch and W3 Total Cache to Work Together [closed]
- DROP TABLE with uninstall hook not working
- How to create a custom shortcode based on the layout?
- Using AJAX to generate front end / viewer end pages
- Is W3 Total Cache supposed to delete the local files after they are uploaded to CDN? [closed]
- WooCommerce search products between price range using WP_Query
- ACF: post query, hide duplicate values [closed]
- Redirect to another page using contact form 7? [closed]
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- How to get a list of bundled products using wp_query in woocommerce
- WordPress Apply filter in plugin causes 500 internal error
- Meta query for comparing two dates
- Replacing global wp_query
- Error in pdf generating plugin using FPDF
- Return multiple values in a shortcode attribute
- Loop returns the current page’s permalink and guid instead of the post in the loop
- Add user meta after a user has registered and logged In [closed]
- Object Caching Plugin force every plugin to cache objects?
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- BuddyPress activity on edit post for a CPT
- Delete data from custom table when deleting a post
- Sociable buttons displaying seemingly at random [closed]
- Pagination not working
- W3 Total Cache Help – How to update DNS Zone for a static domain [closed]
- How to find the WordPress Nextgen galleries which are not used in WordPress posts?
- What archive plugin works with W3 total cache? [closed]
- Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
- Woo-commerce Update price as a Bulk from My offline software export
- How to search post titles with whole words only, but not the exact word only?
- Memcaching recurring SQL Queries
- Use get_pages() before another plugin modifies it
- how to display recent post by category on home page
- How to Join wp_posts & wp_postmeta table using custom query
- What database state changes happen after a post is manually “updated” with no changes?
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- any word search WordPress
- Warning: call_user_func_array() problem can anyone help with it?
- Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /../plugins/rm-payment.php
- adding dynamic/multiple slug values in ‘option_none_value’
- My wp database has been hacked
- How can I disable W3 Total Cache Image Lazy Load for Specific Post Type?
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Is it possible to custom set query for a WordPress REST API response?
- Only return taxonomies that are linked to a category & product
- How to add specific posts to specific pages in WordPress?
- How to use information from the database in the front-end?
- User Following System
- How to fix slow comment query?
- ACF Query result in a new td (echo)
- Multiple Meta key in search
- wp_schedule_event function reference
- Primary Menu doesn’t show because of w3 cache
- History of page, interval of years
- How to insert variable which contain array value in wp_options table?
- Trending Tags based on post views
- Plugin does not create a custom table upon activation
- How can i see/log all requests coming from a registration form (not from the UI)?
- W3 Total Cache Can’t Really Detect Things
- using .htaccess only for wordpress security no plugins
- Second foreach loop breaking (Posts2Posts)
- Advanced Custom Fields (ACF) Plugin – Random Image in Sidebar
- Ger posts from similar tags and categories
- wp_query for more fields plugin
- WordPress filter function using query modifications
- wpdb get_var is not returning any result (verified mysql query returns only one value)
- WP-Snap too slow (caused by WP_Query?)
- WordPress Meta Query: Relation is not working correctly
- WordPress ultra slow if I click on posts?
- Insert data in custom table during new post creation
- Making a Custom Post Type Publish Loop
- Include subtitle display to slideshow
- Checking url from plugin [duplicate]
- W3 Total Cache and IIS7 not doing much [closed]
- Browser Cache causes ‘Orderby=rand’ to return the same posts
- Order custom post type by posts with most likes first
- Accessing Correct Database to Create REST API Endpoint