Working with custom taxonomies in views

Support MB Views Working with custom taxonomies in viewsResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36941
    ArnoArno
    Participant

    Hi,

    When working in views, there's a lot of help to get the syntax for custom fields (button Insert Field). But there's nothing for custom taxonomies attached to posts, is that right? I'm supposed to use WordPress functions like mb.wp_get_post_terms, check with mb.count if it returned terms, etc?

    Just wanting to make sure I am not missing an easier way to deal with this.

    #36954
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Yes, the fields in the Insert Field tab are some basic and registered custom fields for objects (post, term, user) and the settings page. If you want to work with PHP and WordPress functions for some advanced cases, you also need to have basic knowledge about Twig code.

    Refer to the documentation https://docs.metabox.io/extensions/mb-views/#twig
    https://docs.metabox.io/extensions/mb-views/#running-php-functions

    #36956
    ArnoArno
    Participant

    Thanks, I got it working now.

    Perhaps for a feature version of Views it would be a good idea to also add some help for working with taxonomies that are related to the post. That's pretty common. Almost all my custom post types have custom fields as well as custom taxonomies.

    #36960
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I will inform the development team to consider supporting this case in future updates.

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