I really didnt have chance to test it with WPRocket, I am using WP Total cache, didnt have any issues.
I tried to ask chatgpt for possible solutions, and this is the answe I got:
Exclude Cache for Shortcodes: In WPRocket settings, go to Cache and add the page URL or shortcode to the Never Cache URL(s) section.
Defer JS: Enable the Defer JavaScript option in File Optimization to delay JS loading and avoid conflicts.
Disable Minification: Sometimes minification messes with complex JS or shortcodes. Try disabling Minify CSS/JS files in File Optimization.
Clear Cache: If you’re updating posts often, make sure to clear the WPRocket cache to avoid serving stale data.
Check for JS Errors: Open the console (right-click > Inspect > Console) to see if any errors pop up, especially when loading posts.
Hopefully in one of these you will find your solution
Here you are new link:
I am using W3 Total cache. The script I am using is still in use on my website with 3 different settings (newest, popular and featured category) without any issues until now.
Here is the new link to the file:
https://file.io/XMUi2BDrmu6k
these numbers for 24h, 48h and 7d didnt work for me at all. Often I see some posts in popular section which were too old to be there, that is why I made my own shortcode and limited displayed posts to show only ones published in last 7 days.
Also with this code there is no need for all those addtional numbers to be stored in database, so I think it helps perfomrance too
I had similar problem with my website with this popular posts. I solved it in a way that I made custom shortcode for sorting based on total number of views (not in last 7 days or 48h). In shortcode you have the option to choose how old you want your posts to be. hat means that it wont show posts older than 7 days (or any other number of days defined in shortcode) even though if they are visited.
Here is my codes which works for me in my Newspaper child theme. Use it freely if it suits you and your website.
Code in functions.php file in child theme:
// Include the popular posts shortcode file
include_once get_stylesheet_directory() . '/sedamdana-popular-shortcode.php';
File in child theme whic I named “sedamdana-popular-shortcode.php”
(this forum is not allowing me to share code from my php file, so I uploaded it on link: https://file.io/PSWL4VdNb7xN)
The shortcode output is styled using CSS defined in the PHP code. You can further customize the styles by modifying the CSS within the bhcrow_posts_shortcode_styles function.
Once the PHP code is added, you can use the [bhcrow_posts] shortcode in your posts, pages, or widgets where you want to display the list of posts.
Example usage: [bhcrow_posts title=”Popular Posts” number=3 days=30 category=”technology” sort=”visits” show_date=false]
Customize the shortcode attributes as per your requirements. For example, you can change the number of posts displayed, the sorting criteria, or whether to show thumbnails or dates.
The shortcode [bhcrow_posts] can accept several attributes to customize its behavior. Here are the available attributes and their default values:
title (default: ‘Posts’): The title of the section.
number (default: 5): The number of posts to display.
days (default: 7): Number of days to consider for displaying posts.
category (default: none): The category of posts to display.
show_thumbnails (default: true): Whether to show post thumbnails.
show_date (default: true): Whether to show post dates.
show_visits (default: true): Whether to show visit counts.
show_category (default: true): Whether to show post categories.
show_title (default: true): Whether to show post titles.
sort (default: ‘visits’): Sorting criteria for posts (‘visits’ for popularity, ‘latest’ for latest posts).
title_limit (default: none): Character limit for post titles.
cache_duration (default: 60): Cache duration in minutes.
The final output is cached using set_transient to improve performance by avoiding repeated database queries.
After adding the shortcode to a post or page, view the page on your website to see the output. The posts should be displayed based on the attributes you’ve specified in the shortcode.
Remember to backup your files before making any changes, especially when editing theme files or using any PHP code.
I use it without any issues on my website Visoko.co.ba news portal
Here is the screenshot of it. I use it with minimum options on my homepage.
-
This reply was modified 2 years by
bhcrow.
Great, I didnt update it to latest version, I am still on 12.6.1
Thank you very much
I understand that I can disable it, but as I wrote we need this. My suggestion was just a way to make it simpler
I saw here on the forum a lot of users asking for same thing. I think right now this is too complicated. For it to run properly you have to turn on:
– option in theme panel to show views on post
– 24h/48h post views sorting
– ajax view count
– insert the element for single post views inside template for single post
– hide with css showing views on frontend.
And we all know that this uses a lot of server resources to be implemented and if you didnt do this all properly this option is not working. These days to have Popular posts block on your website is MUST.
With the options I proposed everything would be much simpler. Post views in backend are working even without all options turned on. If we can just use that with filter to show only posts published 7 days ago.
-
This reply was modified 2 years by
bhcrow.
This is still an issue, we really need to get previously hidden elements in composer.
Sorry, I added wrong link above for the screenshot where I cant see custom fields showing post views for 7 days count
No post views 7 day custom field
-
This reply was modified 2 years by
bhcrow.
Hello,
I just want to post possible solution for others who may face similar problems, because I think that I found out what was causing my problem resetting all the theme settings.
I have Wp Total cache plugin installed and among other turned on option for Database cache and Object cache. After I disabled those two options (it was 10 days ago) I didnt face with this issue any more. Hopefully it will stay like that.
Probably problem was causing was just one of the mentioned options, but I really couldnt test anymore and I just left it like that satisfied that it works now.
So, if anyone else face something similar you can try turning off one of these options.
-
This reply was modified 2 years by
bhcrow.
Hi,
unfortunately your suggestions which you sent to me in email after my site inspections didnt help. My site is keep reseting randomly and it is very embarassing for a news portal which exists from year 1997.
As an update for the rest of people who may face similar problems I tried turning off Import backup settings, deleted all other Newspaper Theme versions. Deactivated some less known plugins which I thought that might cause some conflicts but nothing helped.
Happened again today, after i did update. I noticed that theme panel created backup file of the theme settings on the exact moment when this happened:
This time I was doing some changes on the home page and dont know for sure if saving changes triggered something or not. My ip in these logs is first one xx.xxx.251.62, server ip is xx.xx.55.78
I located raw access logs at the exact moment and this is what I find out:
xx.xxx.251.62 – – [20/Oct/2023:10:11:31 +0200] “POST /wp-json/td-composer/save_post?uuid=93e6cd11-16f8-6afc-2ba0-c2f39d4ad43d HTTP/1.1” 200 2 “https://visoko.ba/wp-admin/post.php?post_id=343886&td_action=tdc&tdbTemplateType=page&prev_url=%2F%2Fvisoko.ba%2Fwp-admin%2Fedit.php%3Fpost_type%3Dpage” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36”
66.249.64.161 – – [20/Oct/2023:10:11:34 +0200] “GET /foto-iskoristite-priliku-za-jesenje-jahanje-u-konjickom-klubu-visoko-sa-20-popusta/ HTTP/1.1” 301 – “-” “Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.88 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
xx.xx.55.78 – – [20/Oct/2023:10:11:35 +0200] “POST /wp-cron.php?doing_wp_cron=1697789495.1154799461364746093750 HTTP/1.1” 200 – “-” “WordPress/6.3.2; https://visoko.ba”
xx.xx.55.78 – – [20/Oct/2023:10:11:35 +0200] “POST /wp-cron.php?doing_wp_cron=1697789495.1087980270385742187500 HTTP/1.1” 200 – “-” “WordPress/6.3.2; https://visoko.ba”
xx.xx.55.78 – – [20/Oct/2023:10:11:35 +0200] “POST /wp-cron.php?doing_wp_cron=1697789495.1114730834960937500000 HTTP/1.1” 200 – “-” “WordPress/6.3.2; https://visoko.ba”
xx.xx.55.78 – – [20/Oct/2023:10:11:35 +0200] “POST /wp-cron.php?doing_wp_cron=1697789495.1292650699615478515625 HTTP/1.1” 200 – “-” “WordPress/6.3.2; https://visoko.ba”
31.13.115.2 – – [20/Oct/2023:10:11:36 +0200] “GET /wp-content/uploads/2023/06/kulin-ban-fest.jpg HTTP/1.1” 200 231155 “-” “facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)”
109.163.174.56 – – [20/Oct/2023:10:11:37 +0200] “GET /wp-content/uploads/2022/03/pjimage.jpg HTTP/1.1” 200 289462 “https://www.google.com/” “Mozilla/5.0 (Linux; Android 12; SM-G996B Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36 GoogleApp/14.40.33.28.arm64”
69.162.124.231 – – [20/Oct/2023:10:11:37 +0200] “GET / HTTP/1.1” 200 388471 “http://visoko.ba/” “Mozilla/5.0+(compatible; UptimeRobot/2.0; http://www.uptimerobot.com/)”
34.254.111.76 – – [20/Oct/2023:10:11:37 +0200] “GET /kategorija/bih/politika/ HTTP/1.1” 200 158906 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36 Edge/12.246”
xx.xx.55.78 – – [20/Oct/2023:10:11:38 +0200] “POST /wp-cron.php?doing_wp_cron=1697789496.6574571132659912109375 HTTP/1.1” 200 – “-” “WordPress/6.3.2; https://visoko.ba”
109.163.173.240 – – [20/Oct/2023:10:11:34 +0200] “POST /wp-admin/admin-ajax.php?td_theme_name=Newspaper&v=12.6.1 HTTP/1.1” 200 – “https://visoko.ba/teska-noc-za-visocke-vatrogasce-2/?fbclid=IwAR3hbNKPV5qjWWRqUkqcQI3sO-Vi84xWDo3KFzVCUFknDClYOcqycTVrQ10” “Mozilla/5.0 (Linux; Android 10; JNY-LX1 Build/HUAWEIJNY-L21; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.93 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/389.0.0.42.111;]”
I had version 12.6 which is now updated to 12.6.1
Here are the rest of the activated plugins: https://ibb.co/4mdLp2q
-
This reply was modified 2 years by
bhcrow.
I have found this old post looking for solution for my website. I have live news portal page which has same issue as described above. In last 24h all setting reset itself to default twice. Yes, I have backup for settings and I import them back. Also I need to set to global my cloud templates which also resets.
I dont have this Ajax search plugin on my website. I have folloowing active plugins:
Admin notices manages
Adrotate banner manager
advanced editor tools
classic editor
codestyling localization
crop thumbnails
custom sidebar
disable comments
facebook comments plugin
feautured image in rss feed
open graph and twitter card tags
optimize images resizing
really simple ssl
Smash Balloon Custom Facebook Feed
Solid security basic
standard widgets
tagdiv cloud library
tagdiv composer
tagdiv speed booster
tagdiv standard pack
theia sticky sidebar
thumbnail upscale
w3 total cache
wp rest api
wp-cors
wp-polls
wpcode lite
yop poll
thx for your effort with your custom css I did what i wanted to do with my block.
Hope to see new update soon as there are few bugs there which need to be fixed.
https://i.imgur.com/XhoKDsK.png
Hi Calin,
I didnt set black border nowhere, I actually wanted to use grey one. But for inspection I changed it to red now.
I have standard pack activated, but SHOW POST VIEWS were disabled, because I dont want views to be shown anywhere on my site.
I tried to activate this option, but then hide it with display: none; and it shows for one second then it dissapears which I dont like.
For now I am using wp popular posts widget on my homesite, but I would rather use some block from newspaper theme.
can we expect this to be fixed soon? i remember it working before on previous versions of newspaper and newsmag
Hi Calin, thx for your answer
I am using latest Newspaper 10.2, just installed few days ago
On mobile version of my site https://visoko.co.ba I am trying to set gray borders between posts, but they come black whatever I do
here you can see Flex block 1 in action on my site: https://i.imgur.com/oV51OQm.png
it doesnt work, DELETE option is greyed out

no solution for this? this is advertised part of this theme, and it isnt working at all
I have same problem, Popular last 7 days returns empty block without posts. How can we solve this?
I have a project which I need to publish before tomorrow, and I have this one block on our home page (Flex block 1), but it isnt working as it is supposed to.
I used this before on earlier versions of Newsmag and Newspaper themes, and it was ok.
Is there any override so I can fix it manually before new update arrives?
thx for answer, i really think that displaying posts from 7 days ago would make things easier to you to implement together with cache. There would be small problem for people who doesnt post that much often, but they can use Popular All Time function instead of this.
ok, this did hide category tag that i wanted, but instead of totally hiding it, can there be other (secondary) category tag listed? Same as we do it when pickin primary category in posts?
For example: if one post had three categories: SlideNews, Sport and Basketball, and i dont want to show “SlideNews” ever beside my titles on blocks, but i want Sport and Basketball instead of it
but i do want to show category tags on big grid. Only thing is that i dont want specific tag fromspecific category to be shown. I can disable specific category tag to be shown on posts, but not in blocks. That is what i need.
