Exclude Individual Posts from Grid

Assigning posts to an Essential Grid is fairly easy with the ability to choose between post type, categories, and tags. But if you need to exclude specific posts from the chosen source, this article will cover how this can be accomplished.

Example scenario where you might want to exclude a specific post

  • You wish to include “Category A” and “Tag 1” as the grid’s source.
  • “Category A” may or may not contain “Tag 1”, and vice versa.
  • Posts with “Tag 1” may also contain an additional category named “Category B”.
  • You wish to exclude posts that have “Category B” assigned.

The easiest way to exclude specific posts from a grid is to use the “post__not_in” Additional Parameter.  In the following screenshot, the grid would exclude posts with the ID’s “10” and “25”

But if you’d rather not update the “Additional Parameters” value each time you wish to exclude a post, and instead would like to do this from within the post itself, here’s how this can be accomplished:

Step 1:

Add the following to the “Additional Parameters” section.

meta_key=eg-hidden-item&meta_value=0

Step 2:

Create a new “Custom Meta” with the following settings.

Step 3:

Inside the post’s “Essential Grid Custom Settings” section, assign the number “1” to your posts that you wish to exclude.

Special Note

Because the number “0” was designated as the Custom Meta’s default value (see “Custom Meta” screenshot above), this value will automatically be assigned to your other posts.  But you may need to visit these posts in your WP admin and click “Update” for the value to be officially assigned.

Recap

  • Essential Grid Custom Settings -> Custom Meta -> Hidden Item -> 0 = DO NOT exclude post from grid
  • Essential Grid Custom Settings -> Custom Meta -> Hidden Item -> 1 = EXCLUDE post from grid
Exclude Individual Posts from Grid

Further Resources for Web Design and Development Enthusiasts

Alright! We've embarked on quite an adventure exploring the realms of this topic. But why stop there? The world of web design and development is vast, and there's always more to learn and discover. Let's dive into some resources that'll keep your knowledge fresh, your skills sharp, and your passion ignited:

The Author

KC

Strength does not come from winning. Your struggles develop your strengths. When you go through hardships and decide not to surrender, that is strength.

Liked this Post?
Please Share it!