I want query filter by date field, between "this week" to "future week(1)" .
And in other view "future week(1)" to "future week(2)" etc...
Not "today" to "future_day(7)"!!!
Week Starts On Thursday in my WP settings. (cinema program change day)
Any idea or custom shortcode ?
I think you need to set up your Query Filter to filter by custom field date between two shortcode attributes (see the attachment). Then you need a custom shortcode that will return the Unix timestamp at 0:00 on the most recent Thursday. You should be able to pass a shortcode argument into the custom shortcode that allows you to set the number of weeks from now, so you can get the timestamp for this Thursday, next week Thursday (1), the following week Thursday (2), the following week Thursday (3), and so on. So the shortcode must look something like this:
[ts-thursday index="0"][/ts-thursday]
The custom shortcode must return the Unix timestamp at 0:00 (12:00 am) on the most recent Thursday (currently that would be 1593648000). If you pass in 1, it will return the Unix timestamp at 0:00 on the next possible Thursday (currently that would be 1594252800). If you pass in 2, it will return the following Thursday ( currently 1594857600 ), and so on. You will register this shortcode in Toolset > Settings > Front-end Content > 3rd-party shortcode arguments. Then you can use it in the View's shortcode attributes like this:
Films this week:
[wpv-view name="Your View Name" start="[ts-thursday index='0'][/ts-thursday]" end="[ts-thursday index='1'][/ts-thursday]"]
Films next week:
[wpv-view name="Your View Name" start="[ts-thursday index='1'][/ts-thursday]" end="[ts-thursday index='2'][/ts-thursday]"]
Films in two weeks:
[wpv-view name="Your View Name" start="[ts-thursday index='2'][/ts-thursday]" end="[ts-thursday index='3'][/ts-thursday]"]
Will this setup work for your project requirements? If not, please provide more details.
I registered the shortcode.
I created a query filter.
I use it in the View's shortcode attributes but the result is not good...
(see attachments)
Simple [wpv-view name="heti-bontas"] code is tested... working
Where did I go wrong?
Right, it's not a complete solution - there is no ts-thursday shortcode unless you create one. I suspect you did not create a ts-thursday shortcode. I didn't create one in my example code, I was giving you some ideas you could use in your own custom solution. If you want to use the code I provided as-is, you must also create a custom shortcode that calculates a timestamp for Thursday at 00:00, using the "index" shortcode attribute, and returns that timestamp value. Save that code in your child theme's functions.php file, or in a new snippet in Toolset > Settings > Custom Code. Here is the template you can use for creating the custom shortcode ts-thursday. Add your custom code after the comments in this template to calculate the correct timestamp value.
add_shortcode( 'ts-thursday', 'ts_thursday_func');
function ts_thursday_func( $atts, $content ) {
$atts = shortcode_atts( array(
'index' => 0
), $atts );
$week_index = $atts['index'];
$timestamp = 0;
// your custom code here should calculate the correct value for $timestamp
// $week_index will default to 0 unless the User provides one in the shortcode: $week_index
return $timestamp;
}