![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
Tagged: Custom Post Type
-
AuthorPosts
-
November 25, 2019 at 1:04 am #1159727
Hi!
I’m currently working on a client site where we are using
add_theme_support('add_avia_builder_post_type_option');
to select a custom post type when using the ALB “Blog Post” block to select a custom post type to be shown.The problem we are encountering is, that we simply want to show all posts of that post type no matter what taxonomies they have. To reflect that we did not select a taxonomy entry (i.e. a tag or a category) in the Blog Post Block settings “Which Entries?”.
But now posts that do not have any categories/tags/etc assigned at will not be listed! Only when I assign a taxonomy (according to what is selected in the Blog Post Block settings dropdown for “Which Entries?”) it is shown.I investigated a bit and it seems that in the block at enfold/config-templatebuilder/avia-shortcodes/blog/blog.php:315 there will always be categories written to the args even if nothing is selected. This results in only posts with anything assigned to be returned.
If that block is skipped, the posts without taxonomies are shown correctly.Is this intended behaviour or a bug? And if its fhe former: Is there an official workaround (other than assigning meaningless categories/tags/etc)?
November 25, 2019 at 4:38 pm #1159906Hey IncrediblePineapple,
It is the intended behavior, but if it does not work for you, you can customize it or add the blog post element when you have posts in the category that you want to show.
Best regards,
VictoriaDecember 1, 2019 at 8:49 pm #1161665Hi.
Thanks for letting me know about that.
I ended up setting a default category for all posts of that particular post type as a workaround just so that they show up in the listing (they were not supposed to have taxonomies but well as long as it is added automatically it’s fine).
For anyone stumbling here in the future, instructions for the workaround can be found here: Stackexchange – Setting Default Category for Custom Post Type Upon Autosave-
This reply was modified 4 years, 9 months ago by
IncrediblePineapple.
December 3, 2019 at 7:26 am #1162081 -
This reply was modified 4 years, 9 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.