Meta Key/Custom Field as source filter (essential grid)

Hi guys,

I started using Essential grid after a long time using the grid, i was wondering if in essential grid there was a way to filter PAGE content through metakeys.

i created a series of pages that i want to show on a slider. i know i could just select the pages and that’s it but the quantity of those "Types"of pages are going to change from time to time and i want to have it automatically set up by essential grid.

with the grid i could just create an “and / or” rule where i would specify i would only like to show the pages of a certain meta key value. let’s call the meta key “event-type” and the value i want to use “seminar”.

i only want the grid to show the pages with the seminar value set on the meta/custom field “event-type”

i checked theme punch’s documentation but could only find the sot option that would just reorder the items in a different way, yet it won’t filter out the content i do not want (i don’t want pages like homepage or about us showing on the slider)

i was wondering if by any chance that wasn’t possible with ESSG (i wouldn’t mind coding it if i knew how, i’m new to ESSG and don’t know the parameters or functions they offer),

could you point me to the right direction?

Thanks!

Hi there,

Thanks for writing in,

The meta query is only applicable as array since it’s a pair value, you must use custom code on that one. Like in here https://www.themepunch.com/faq/advanced-additional-parameters/

Example,

if($grid_id == 36){
 
$query['meta_query'] = array( 'key' => 'event-type', 'value' => 'seminar' );
 
}

Hope this helps.

Yeah, i found that page and a similar thread after writing this one,

however, the metakey starts with “eg-” which is the prefix they automatically add, can you confirm i do not have to add that as a parameter and leave “event-type” (as you wrote above)?

Hi elpanda13,

I’m sure if you defined this meta key in (Ess. Grid > Meta Data Handling) page, then you will have to add eg- as a prefix for your meta keys.

Thanks.

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