Resolved.
My error are there :
$FirstDayThisMonth[] = date('Y-m-01 00:00:01', mktime(0, 0, 0, $x, 1));
$LastDayThisMonth[] = date('Y-m-t 23:59:59', mktime(0, 0, 0, $x, 1));
instead of :
$datestart = strtotime(date('Y-'.$nbofmonth.'-01 00:00:01'));
$dateend = strtotime(date('Y-'.$nbofmonth.'-t 23:59:59'));
It’s always very annoying to have well written code and to realize that a small element breaks everything
Related Posts:
- datetime picker, timestamps and meta queries
- Query by custom dates in UNIX Time
- Display upcoming events in the next 30 days by querying posts with timestamp in custom meta
- datetime picker, timestamps and meta queries
- Use REGEXP in WP_Query meta_query key
- How to list some posts first in the loop based on post id
- Whats the difference between post_limits and pre_get_posts?
- How to add taxonomy filter on the query fly?
- Changing Posts Per Page and offset with pre_get_posts
- ajax category filter
- Using WP_Query To Get Posts Randomly From today
- WordPress Custom Query to show posts from last x years
- How to order posts tag by tag?
- Overriding The Loop with filter or hook
- WP Rest API v2 return posts with specific tag
- Ignore a filter on the media library
- How to support multiple search terms query within one process?
- How to get the posts published in last two days using WP_Query?
- How to get any tag ID
- List taxonomy terms plus their latest post ordered by post date
- Which filter/action hook gets triggered after a query has been performed?
- How to filter a dd/mm/yyyy date from a custom field in a query
- Custom Field sort not working (WP 3.8.1)
- Use meta_query to display events by date in custom field
- Remove ellipsis from the excerpt retrieved using get_the_excerpt()
- Removing posts from the returned wp_query. Cannot use object of type WP_Query as array
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- What’s the point of the query_vars filter?
- Refine/Filter WP_Query Posts with jQuery or Ajax
- Use ‘parse_query’ filter to show posts that from multiple criteria
- How to apply filter inside a single wp_query?
- What is considered a default query for the request filter?
- Using apply_filters(‘the_content’, $custom_query->post_content) alters output
- Modifying the Search Results
- When to add_filter() to Custom Query
- Query total number of posts
- How to add post_distinct filter to WP_Comment_Query?
- Using Ajax to load more posts | Help me change the wording on my button to notify the user
- How to use filter hook “the_posts” with a function that refers to $this?
- query_vars filter not working even though query string parameter is present
- Order by title without taking into account ‘the’
- How can I filter by slug depending on language selection
- How can I create ‘future’ and ‘past’ parameter for restAPI by filtering the CPT custom date field by greater than / less than current datetime?
- How to filter, restrict and return posts based on custom user meta information
- Bypass “supress_filters” in WP Query
- Filter posts in category archive page by year using a dropdown
- Applying posts_clauses filter to specific queries only
- Add class to first post in custom loop using post_class filter
- WP_Query with different postmeta filter for each categories
- Slow WP_Query with ‘OR’ on meta_query
- Add posts to WP Query object
- 2 weeks ago from meta query meta value
- How to filter a query by date in a shortcode?
- how to access query string in wordpress?
- Filter Custom Taxonomy Posts
- Include posts from some categories while excluding from others
- Filter post query to only show direct children of category
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Change AJAX filter from POST to GET for URL Parameters
- Using post_where filter only on main query NOT sidebard new WP_Query
- Filtering posts by archive showing all years
- WP_Query – How to get all posts of specific days of week by custom field date?
- Multiple wp_query on archive page
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- Remove post type filter added by the plugin in the final query
- WP Query and date format
- Filtering by multiple conditions in the loop
- relation OR instead of AND – Filtered term ID’s in loop
- Can’t order the query result as given posts id’s array
- filter posts by meta key with pagination
- Why does apply_filters behave different inside and outside a loop?
- Custom post type – filter content by custom meta box content
- Filter sub-category from checkbox form
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- My combination of ‘post_type’ and ‘tax_query’ not working?
- Custom meta_query order for Elementor based on post meta key [closed]
- How to add a “base” filter for all posts visible to visitors on the site?
- query hook parse_tax_query function takes no effect
- WordPress – Form does not filter the results of taxonomies
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- Sorting query_posts() with a complex orderby filter
- WP Query filters active on wrong query
- Custom category page with taxonomy filters
- Insert wp_query after the_content with plugin (filter the_content won’t work)
- Gather same custom field values in one value in a select tag with wp_query
- WP_Query doesn’t works inside loop
- Track write actions to the database
- Fetch only categorized posts
- Using WP_Query to re-query and sort results using a date?
- Add filter to Orderby Parameter using Array
- WP_Query Sorting Posts by month … timeline effect
- query post based on comparison
- Do not show a custom post if it belongs to a certain custom taxonomy
- wp_query->set for several categories
- Adding arguments to WooCommerce Product Loop using AJAX
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- List categories using WP_Query
- Why does wp_query only display the most recent post when using order ASC?
- I need to get all categories from a WP_Query