How to exclude post_type asides from being displayed?
I tried to figure it out via the query post link you give but its above my head.
You can see in the link below that the 2 posts that are post_type aides don’t have a title or an image so I’d like to exclude them.
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
11Hi Ovidiu
Please see my answer here: Thread: How to add masonry to my categories?
Thanks :)
Sorry Andrew I made a mistake, I didn’t mean to ask about posts and categories but rather about post formats => https://codex.wordpress.org/Post_Formats#Supported_Formats
Say if I have a category containing psots with different post formats but I only want to show certain one or hide certain ones? i.e. there is a psot format: image and one gallery say I only want to show those two formats from a specific category?
Ahh right, got you. I’m not sure that’ll be possible in the widget. In theory it should be. Here is a little on how that might be done in a conventional query argument:
https://codex.wordpress.org/Class_Reference/WP_Query
See: Nested Taxonomy Handling.
A more manual way of excluding specific posts might be to use:
Where 1 and 2 are the post ID’s we are hiding. We could do the same with categories:
OK, I get your example above with cat=-1 for example but in a more complex example, say this one (taken from the page you linked to) which part would I copy into that line for the wp query argument, would that be the whole code I posted below?
Hi Ovidiu, so sorry about the delay. I wasn’t checking my forum priority lists properly and missed your reply. My bad!
Our new Post Loop widget has a query builder, making this much easier. Try this.
Add a Post Loop widget.
Click Build Posts Query.
In the Taxonomies field search for “image”. In this example, if you have posts saved as Post Format: Image you should see a result as follows: “post_format: image”. Choose that.
Your query will now only display posts with the format “image”.
Next you could use the Taxonomies field again and search for a category. You can keep adding onto on the query.
You can also use the Additional field at the bottom to manually exclude a category.
Hopefully this gets you going.
Thanks, the new query builder is ingenious, there is just one thing that could be better:
say I select post_format: image in taxonomies field then wan to add 1 specific post by selecting it, that narrows it down because by default its an AND selection.
say I select post_format: image in taxonomies field then add a second taxonomy again it gets narrowed town as its an AND selecttion.
This tool would be so much more powerful if we could select between AND / OR relations between the criteria we can select via the query builder.
i.e. add 1 specic post select OR and select a category, meaning I get the full category + the one post
or alternatively
select 2 categories and put OR between them so I get both
Do you think this is doable maybe in a future version?
Hi Ovidiu, thanks for the feedback, it’s how we improve things. Let me chat to Greg about this tomorrow and come back to you. I can definitely see the use case for building a query as you’ve described. In the short term I think it’ll be a limitation of the query builder. We’ll chat on our side tomorrow, look at what’s possible and come back to you with some feedback :)
Cool, thanks for considering, it would be quite an improvement.
Btw. here’s a similar query builder, just to give you some ideas.
Thanks again for your feedback on this. I’ve passed it onto Greg. For the moment we’ve marked this as a feature request.
Could you perhaps let me know the name of the plugin you tried. The link unfortunately didn’t come through.
Thanks :)
oh, no idea why the link is missing but its called Query Wrangler https://wordpress.org/plugins/query-wrangler/
Super, thanks for sharing that with us. We’ll take a look.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.