Essential Grid - Hide Post with JQuery

Hi,

Is there an option to hide a post in a grid with JQuery?
I’m asking because the grid needs to be redrawn after any change for the grid items to be properly arranged.

Thanks.

Hi There,

You can try with this custom code:

jQuery("#eg-1-post-id-321").remove();

The 1 number is the grid ID and 321 number is the post ID.

Hope that helps and thank you for understanding.

It works perfectly, including the arrangement of the grid items. Thank you!
Is there an essential grid documentation where similar helpful scripts and possibilities are listed for EG users? or it’s just a good sense of JS?

Thanks!

Hello Amir,

The JS code is custom specifically for your site.
You may find the documentation that might help you from here:

Hope this helps.

Well, then I extra appreciate it.
May I ask what would be the best way to use it if I want to remove several posts at a grid?

Thanks!

Hi Amir,

You can create a category, for example call it hidden-posts

Then assign all post you want to remove to that category.

You can then exclude that category in your grid.

Please check the link below for a more detailed information.

https://www.themepunch.com/faq/exclude-individual-posts-from-grid/

Hope that helps

Sorry for not being clear enough, my question was about thai’s method:
jQuery("#eg-1-post-id-321").remove();

How can I use that specific method for several posts?

Thanks!

Hi Amir,

Yes, you may separate selectors using comma.

For example


jQuery("#eg-1-post-id-321,#eg-1-post-id-322,#eg-1-post-id-323").remove();

Make sure to change the posts id

Thanks

Appreciate the quick response, will check it out.
Thanks!

You’re most welcome Amir! :slight_smile:

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