Is it possible to show a single Essential Grid for the current post within the post page? Looking to single out just the current post grid item from a particular grid.
Hi There,
Do you mean just one post inside a essential grid?
First, to exclude current post from essential grid, see this: https://www.themepunch.com/faq/exclude-current-post/
To create the essential grid, see this guide: https://theme.co/apex/forum/t/extension-essential-grid/68
To add essential grid after every post, see this:
https://theme.co/apex/forum/t/implement-some-shortcode-into-wp-single-php/18044/2
From the code, replace [recent_posts count="3"]
with essential grid shortcode.
Hope this helps.
I guess the recent post count shortcode is throwing me off. I’m not trying to show the recent posts, I want to be able to show the post inside of the post page via the Essential Grid. I want to exclude all other grid items except for the select post. So, if you’re in example.com/happy-feet, I want to be able to just show the happy-feet post via the essential grid.
Hi,
Sorry for the confusion.
That’s possible with Essential Grid plus custom query, like from here https://www.themepunch.com/faq/advanced-additional-parameters/
Try adding this in your child theme’s functions.php
add_filter('essgrid_query_caching', 'eg_stop_caching', 10, 2);
add_filter('essgrid_get_posts', 'eg_mod_query', 10, 2);
// turn off caching for your grid
function eg_stop_caching($do_cache, $grid_id) {
if($grid_id == YOUR_GRID_ID) return false;
return true;
}
function eg_mod_query($query, $grid_id){
if($grid_id == YOUR_GRID_ID) {
//modify $query to your likings
$query['p'] = get_the_ID();
}
return $query;
}
Make sure o change YOUR_GRID_ID
with your ess grid id
Hope that helps.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.