Skip Navigation

[Resolved] Hide a specific post from view?

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Dee_DeeA2948 5 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#1218952

Tell us what you are trying to do?
Hi. I want to create a "Sample Post", but I don't want it to be visible when someone searches. To clarify, this post should be hidden from a view. What would be the best way to do this?
Let me know if you need more clarification.

I found a post that answers my question, but I can't figure out the last part.
The post says:
It depends on how you setup the custom checkbox field "hide from listing", for example, you can edit the custom checkbox field "hide from listing", option "Value to store" fill number "1", see screenshot hide-from-listing.JPG,

**I've done everything about this ^ **

Then in your view, screenshot:
hidden link
You can setup the filter in view, like this:
Select items with field:
hide from listing is a number equal to 1

**I'm getting lost here ^. Can you provide a screenshot. I go to Toolset Views, but I can't figure out how to insert the filter in the view to "hide from listing is a number equal to 1".

#1219137

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-03-21 at 15.52.09.png

Hi there

When editing your View you need to be able to see the Query Filter section.

If you can't, go to the Screen Options tab at the very top of the page and then check the option for Query Filter.

Find that section in the View and then insert the filter.

#1219297
Test1.PNG
Test2.PNG

THANK YOU. I was having the hardest time trying to figure out where the query filter was. So, I turned it on, but I'm only able to get the reverse of what I'm trying to do.

I set "hide from search" is equal to 1 > It shows the post that I want to hide, and then hides the ones that I want to show. I also try changing the logic to

"hide from search" is different to 1, but then it shows no results.

Just to Recap, I have a checkbox field called, "hide from search". I've attached images.

Thank you for your help.

#1219554

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Right.

Well, your custom field is set to not save anything to the database if it is not checked.

You could set it to save zero, and then set your query filter to only show posts if the field = 0.

Note that your existing posts would need re-saving for them to get the zero value, and I'm a tiny bit nervous about recommending that because saving zero to the database has been known to raise issues in the past. So much so that it is explicitly discouraged with checkboxes fields, but you should probably be okay with a single checkbox field if you want to try it.

An alternative might be to have an "Include?" checkbox rather than an exclude checkbox.

#1219747

My issue is resolved now. Thank you!