Custom Fields
Re-Envisioned
Support MB Views Fields Not Showing in Views -- or Frontend

  • Creator
    Topic
  • #28642
    Resolved zenjukai@gmail.com
    Participant

    Hey folks,

    I am having issues, well seem to be having multiple issues with Views and rendering fields on the front end when it comes to the Loop and custom post types.

    Here is a video showing you the issues: https://www.youtube.com/watch?v=2SxeWk8wQgw

    Let me know what you think and if there is an issue or am I missing something.

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #28668
    Long Nguyen
    Moderator

    Hi Zenjukai,

    The archive page of the post type Animal on your site is http:localhost/animal/. The slug /animals/ is a single page. Can you please re-check it?

    #28680
    zenjukai@gmail.com
    Participant

    Hey Long,

    Yes post type plural name is "Animals", the slug, which is autogenerated from the "Singular Name" is "animal". I also tried to change the slug so that it is plural as well, but did not work.

    So after some digging (and maybe this should be put into your documentation) is that when you are adding that page/archive to your menu, you cannot add it from your "Pages" section, but rather from the post type section. You have to click on that post type, then "View All", then you have the Animal Archives which then shows the correct information.

    So all is working but again this should not be so hard. Maybe consider updating your documentation with some clear understanding.

    Cheers

    #28693
    Long Nguyen
    Moderator

    Hi,

    Thanks for your feedback.

    I will add a note on the documentation about this case.

    #28695
    zenjukai@gmail.com
    Participant

    Awesome, thanks Long ... appreciate that -- it also might help folks out, was a hair puller for sure. =)

    Cheers

    #30878
    zenjukai@gmail.com
    Participant

    Hey folks,

    Sorry to reopen this thread ... but I noticed another issue that is related to this posting.

    I can get the fields to render no problem now in the archives page, but that is it. It will no render the fields data on single page, single post, or shortcode.

    Any thoughts?

    Here is a video showing what I am running into: https://www.youtube.com/watch?v=ft8TI3J8qQw

    Cheers

    #30889
    Long Nguyen
    Moderator

    Hi,

    You are using the main query in Insert Field tab > Query > Main query: Loop
    https://docs.metabox.io/extensions/mb-views/#main-query

    {% for post in query.posts %}
        ...
    {% endfor %}

    that means this query only applies to the type: Archive to show the list posts of the archive post type page. And it does not work for a single post or a single page.

    If you want to show a list of animal posts on a single page, you can use the custom query. Please read more here https://docs.metabox.io/extensions/mb-views/#custom-query

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