Essential Grid - Custom Meta date

Hi,

I am trying to get essential grid to only show posts where the custom meta date “eg-date” is not older than the current date.

I have tried using https://theme.co/apex/forum/t/essential-grid-filter-posts-by-custom-meta-data-and-date/29222 to do this however the issue I have is that the ones that are past in the date are still showing on the page.

I was wondering if it is possible to get assistance the code I am using on the x-child functions.php is the following:

// Essential Grids Event Dates
// =============================================================================

function eg_mod_query($query, $grid_id){

if($grid_id == 2){
$query[‘meta_query’] = array( ‘key’ => ‘eg-date’, ‘value’ => date(“Y-m-d”), ‘compare’ => ‘>=’, ‘type’ => ‘DATE’);
$query[‘meta_key’] = ‘eg-date’;
}

return $query;

}

Hi Philip,

Thank you for writing in, while that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

Please follow the documentation provided on the following links.
Apply advanced post queries using one of Essential Grid’s built-in plugin filters.
Customize your Grid’s category/source queries and other advanced modifications.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.