Hello.
Im trying to use ACF to give each post-item a custom margin. So every post has 4 meta items for all values of margin.
Im trying to get post grid to add the margin\'s to each post individually with a function.
<code>
add_action(\'post_grid_layout_element_css_excerpt\', \'custom_css\', 10);
function custom_css()
{
$post_id = $layout_args[\'post_id\'];
?>
.item-{
margin-top: the_field(\'margin-top\')px !important;
margin-bottom: the_field(\'margin-bottom\')px !important;
margin-right: the_field(\'margin-right\')px !important;
margin-left: the_field(\'margin-left\')px !important;
}
?>
<?php
}
</code>
But can\'t get it to work.



Welcome to our forum.
Unfortunately sorry to say, don't understand the issue clearly, could you please send me your post grid page url to see what are you trying to do.
If possible please send me some screenshots.
Regards
Please note filterable style grid doesn't support masonry style right now,
There might be wrong with the code, could you please share your code via https://gist.github.com/
Regards