Custom Fields
Support MB Favorite Posts Show add to favorites in Archive posts / Loop posts

  • Creator
  • #32912


    i would like to show the Add to favorites Icon Button in the Posts of an Archive page. I am using MB Views for the Loop like this:

    {% for post in query.posts %}
    <div class="exposee-teaser">
            <a href="{{ post.url }}" class="exposee-teaser-wrapperlink">                  
                <div class="exposee-custom-bg" style="background-image: url('{% set item = attribute( post.thumbnail, 'exposee-teaser' ) %}{{ item.url }}')"></div>                                 
        <div class="exposee-teaser--text">
            <a href="{{ post.url }}" ><h4>{{ post.title }}</h4></a>
            <div class="exposee-details">
                <a href="{{ post.url }}" >Details</a>
                [mbfp-button class="custom_class" icon="heart" show_icon="true"]
    {% endfor %}

    But the Shortcode is working for the current Archive page and not every individual Posts in the loop.

    Is there a way to achieve this: To get a Favorites button for every post in a loop and the possibility to add an individual post on an archive page to the favorites?

    Thanks in advance!


Viewing 1 replies (of 1 total)
  • Author
  • #32924
    Long Nguyen

    Hi Marius,

    You need to pass the post ID to the attribute id of the button shortcode to show a favorite button for each post on the archive page. For example:

    <div class="exposee-details">
        <a href="{{ post.url }}" >Details</a>
        [mbfp-button id="{{ post.ID }}" class="custom_class" icon="heart" show_icon="true"]

    Please get more details on the documentation

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