WordPress Options
-
Hi,
I picked up maintenance on an older website and they realized today that their “last week’s popular posts” page was no longer pulling posts from last week, it looks to have stopped working at the end of 2020, as the last posts it is pulling are from January.I searched through their theme files and found that they get a query for that page with a custom function:
function get_last_weeks_top_stories($count = 10) { $last_weeks_top_story_ids = get_option( 'last_weeks_top_stories' ); $last_weeks_top_stories = new WP_Query( array( 'post_type' => 'news_entry', 'post__in' => explode(',', $last_weeks_top_story_ids), 'posts_per_page' => $count ) ); return $last_weeks_top_stories; }
Here I can see they are retrieving the IDs stored in
'last_weeks_top_stories'
, and if I go to their wp-admin/options.php page I can see the ID’s being retrieved in there. It appears to be pulling the ‘correct’ posts based on the data in that options file, so this leads me to believe the issue is not with getting the correct data, but whatever is SETTING the most popular posts from last week. This is where the problem is for me.I would think that there would have been some place in the theme or plugins files that would have an
add_option()
, but I cannot find where this option of'last_weeks_top_stories'
is being set at. I have downloaded the entire plugins and theme folder and searched through the files for any mention of ‘last_weeks’ and nothing comes up.They have a plugin installed called WordPress Popular Posts so I was thinking maybe they would be utilizing that, but I cannot see anywhere where that field would be created within that plugin either, or if that is even what they were using to populate the option anyway.
Does anyone have any suggestions on how I could find out where this
'last_weeks_top_stories'
option is being set?Thank you!
- The topic ‘WordPress Options’ is closed to new replies.