Redering for only post content area repeats the display of the posts

Support MB Views Redering for only post content area repeats the display of the postsResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43040
    EddyPiVEddyPiV
    Participant

    Hi,

    I want to show all posts for a category. Works great if I render for "the layout between header and footer", but if I render for "only the post content area" I get all posts repeated for each post. So if there are 4 posts for the category, all 4 are shown, but the series appears 4 times, each time with the title of the next post.

    I want the sidebar to be shown as well. How to get it only once while rendering for only the post content area?

    This is the code:

    <div class="sub_container">
    {% for post in query.posts %}
        <div class="sub_item">
        <p><a href="{{ post.url }}"><img src="{{ post.thumbnail.thumbnail.url }}" width="{{ post.thumbnail.thumbnail.width }}" height="{{ post.thumbnail.thumbnail.height }}" alt="{{ post.thumbnail.thumbnail.alt }}"></a></p>
        <p><a href="{{ post.url }}">{{ post.title }}</a></p>
        <strong>Price: € {{ post.price }}</strong>
       </div>
    {% endfor %}
    </div>
    #43056
    PeterPeter
    Moderator

    Hello,

    I assume that the Type of the View template is Archive and you are using a query loop to display a list of posts. So you should select the option "The layout between header and footer".
    Also, if you want to display a sidebar, please follow a topic that you've created https://support.metabox.io/topic/how-to-add-a-sidebar/

    #43058
    EddyPiVEddyPiV
    Participant

    Thanks Peter.

    You have a better memory than I...

    I managed to get it working.

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