Hi,
I managed to get my sticky posts appear on top in my ess-grid using the following code snippet from Themepunch in Functions.php:
=======================================
add_filter(‘essgrid_modify_posts’, ‘eg_modify_post’, 10, 2);
function eg_modify_post($posts, $grid_id){
/*
Your grid's ID can be found where your grid's are
listed in the plugin's main admin page.
*/
$your_grid_id = 84;
/* *************************************** */
/* no need to modify any of the below code */
/* *************************************** */
if($grid_id != $your_grid_id) return $posts;
$stickys = array();
$regular = array();
foreach($posts as $post) {
if(!is_sticky($post['ID'])) $regular[] = $post;
else $stickys[] = $post;
}
return array_merge($stickys, $regular);
}
==========================================================
As you can see this code applies to grid ID 84.
My question is:
Can I make this code apply to more ID’s?
I tried putting the whole code in twice with two different ID’s but that doesn’t work.
I also tried to sum up two ID’s like this:
$your_grid_id = 84, 85;
And I also tried:
$your_grid_id = 84;
$your_grid_id = 85;
But that does not work either.
Your help is much appreciated!
Regards, Henk