Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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)?

    #1159906

    Hey 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,
    Victoria

    #1161665

    Hi.
    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

    #1162081

    Hi,

    Thanks for sharing, it’s much appreciated. Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.