Custom Fields
Re-Envisioned
Support MB Views Single Image - Custom Post Type - No Data

  • Creator
    Topic
  • #30792
    Resolved uptwo
    Participant

    Hey,

    i've created a view and everything is working so far. The only problem is that I can't get any data for a custom field (single image), all other fields work strangely and I don't know where the error comes from. See code and screenshot:

    {% set args = { post_type: 'mitarbeiter', posts_per_page: -1 } %}
    {% set posts = mb.get_posts( args ) %}
    {% for post in posts %}
    
    <div class="sec-mitarbeiter-container">
        <img class="sec-mitarbeiter-image" src="{{ post.mitarbeiter_profilbild.full.url }}" alt="{{ post.mitarbeiter_profilbild.full.alt }}" title="{{ post.mitarbeiter_profilbild.full.title }}">
        <p class="sec-mitarbeiter-name">
            {{ post.post_title }}
        </p>
        <p class="sec-mitarbeiter-title">
            {{ post.mitarbeiter_titel }}
        </p>
        //more Code here, but deleted, don't want to expand the post further
        <a class="sec-mitarbeiter-social-link" target="_blank" href="{{ post.mitarbeiter_linkedin_link }}" rel="noopener"> {{ post.mitarbeiter_linkedin_link }}</a>
    </div>
    {% endfor %}
    <div class="sec-mitarbeiter-container">
        <img class="sec-mitarbeiter-image" src="{{ post.mitarbeiter_profilbild.full.url }}" alt="{{ post.mitarbeiter_profilbild.full.alt }}" title="{{ post.mitarbeiter_profilbild.full.title }}">

    Isn't working, see screenshot:
    https://ibb.co/1TJhYS0

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