Want to display current day custom post type in series
I have a custom post type called (FDD). I have created 2 series Premium and Free For Free one i just want to display only 1 FDD which will be current day
For example past day ( hidden) current day next day ( hidden)
Any one help ?
Hello @inzamamabbasi,
The list of posts in a series displayed on the frontend of your site is generated by the getPostList() method of the PMProSeries object. In order to customize which content is shown in that table, you would need to use the pmpro_series_get_post_list filter to overwrite the output of that function:
https://github.com/strangerstudios/pmpro-series/blob/bc6de6a3dd35c201d712a893235aac889b2b75c7/classes/class.pmproseries.php#L454
I would expect the code needed for your custom setup to first check if the user has your premium or free level. If they have your premium level, then return the content passed into the filter (all the series information). For your free levels, the code would look fairly similar to the logic already in that function, except you would need to only generate output for posts released to the user within the past day, which can be calculated using these variables: https://github.com/strangerstudios/pmpro-series/blob/bc6de6a3dd35c201d712a893235aac889b2b75c7/classes/class.pmproseries.php#L420-L421
If the post wasn't unlocked by the user in the past 24 house you can output nothing and continue; to the next post.