Excluding (hiding) posts from display based on tags
-
Hi Guys
I am trying to find a way to use tags (categories, or something else) to exclude or hide posts from displaying on the homepage using widgets that populate from a category.
Currently, I have tried to visibility>hide>category>(specified category)
For some reason, the posts don’t display in the customisation preview but as soon as I publish the changes the posts matching the category or tags specified still display?
The site I am working on is littlegreybox.net
Thanks in advance
MattThe blog I need help with is: (visible only to logged in users)
-
Hi there, I’m not certain I understand completely how you are wanting things set up. If you are using the Custom Posts Widget, you then select the category or tag that you wish to show in that particular widget. You generally, if you are using the Homepage widget areas for the Custom Posts Widgets, do not have to worry about visibility settings for the widget since those widget areas only show on the page you have set as your Homepage.
When using the Custom Posts Widget in non-homepage widget areas (header, sidebar, etc.) then you could use Visibility to control on which pages those widgets would show.
If you can clarify what you are wanting to do, perhaps with a concrete example, we can come up with a solution for you.
-
Hi! and thanks for trying to decipher my ramblings :)
Ok, if you visit http://www.littlegreybox.net you may see some posts in the first two cols that start with the title ‘The Week That Was #…’
I have specified in the custom posts widgets to exclude all posts in this category (The Week that Was) but cannot seem to get them to be excluded from showing.
When setting up this in the customiser (visibility>hide>category>The Week That Was) they seem to be excluded… but as soon as I publish the changes they reappear on the live page??
I hope that makes sense. Is there a way I can show you a screenshot to show you my setup inside the widget?
Matt
-
Hi prunomars,
I have specified in the custom posts widgets to exclude all posts in this category (The Week that Was) but cannot seem to get them to be excluded from showing.
Just to make sure I’ve understood correctly — you have chosen to hide the custom posts widget on the category page called The Week That Was (using the widget visibility settings).
However, it sounds like you wish to exclude posts from that category when the widget is displayed on the homepage, is that correct?
I hope that makes sense. Is there a way I can show you a screenshot to show you my setup inside the widget?
Sure, the screenshot can be uploaded to your Media Library :)
-
Hi Gemma
Thanks for your help.
You are right: I wish to exclude posts from that category when the widget is displayed on the homepage
I have uploaded the screenshot of the widget I am working in here: https://littlegreybox.files.wordpress.com/2018/09/screenshot-2018-09-13-21-50-07.png
Matt
-
Hi Matt,
Thanks for the screenshot. I’ve come back to your site and the homepage is no longer displaying posts from “The Week That Was”. Have you got this page set up as you would like now?
I also wanted to mention that your plan includes direct support — you are welcome to reply here or start a new chat if you need any more help.
-
HI Gemma
Thanks so much for looking and helping.
No the page is still not working correctly. Sometimes when I do look (like you did) no posts from ‘The Week That Was’ are showing, but other times they are. This would be because the pool of posts is 600+ in number so sometimes it misses them of course.
It makes no sense to me that I have specified for those categories of posts be excluded but I will always seem them displayed there?
Matt
-
Hi Matt, thanks a lot for the screenshot, it caused a bell to go off for me. The visibility section is on all widgets, and it is to show or hide the widget itself on or from certain pages, not to exclude posts from a category as you are trying to do.
The only thing I can suggest, and it would be a lot of work, would be to list all the categories that you wish displayed in the widget in the Multiple Categories Filter by ID: field. You need to use the category id numbers, and although those are easy to find, they are typically a very long number, it would be quite the job to get all of them and list them out.
To find a category id, the easiest way would be to go to the WP Admin dashboard and to Posts > Categories: https://littlegreybox.wordpress.com/wp-admin/edit-tags.php?taxonomy=category
If you right click on Africa, and copy the link and then paste that into a plain text file, you will see this.
https://littlegreybox.wordpress.com/wp-admin/term.php?taxonomy=category&tag_ID=436348955&post_type=post&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3DcategoryLook in that link and you will see
...taxonomy=category&tag_ID=436348955...436348955 is the category id number. You would then need to put that into the field mentioned above and then a comma, and then find and insert the next number. Might be best to create that comma separated list in a plain text file and then copy and paste that into the field.
The caveat: I’m not sure how the custom posts widget in MH Magazine is going to react to a pretty long list of categories. It may work and then again it may get cranky.
Let us know your thoughts.
-
ahhhh ok that all makes sense. Thanks so much for looking into that for me. I will give it a try sometime and see how it goes and report back.
Matt
-
Hi Guys
That works! It is quite a bit of work and I reduced the number of categories I included by only using the top level categories but it seemingly has removed the undesired posts from the section that I wanted them removed from.
Thanks so much
Matt -
- The topic ‘Excluding (hiding) posts from display based on tags’ is closed to new replies.