Okay
  Public Ticket #2754718
how to show dynamic content of custom fields from custom post ype in a carousel
Closed

Comments

  • Valderes Zimmer started the conversation

    I have a custom post type with some custom fiels and wonna show them  in a carousel.

    I created my coru sel based on the post carousel widget:

    My html:

    <div class="uc_image_carousel_container_holder ue_post_carousel_item">
      <div class="uc_image_carousel_placeholder">
        <a href="{{item.post.link}}"><div style="background-image:url({% if item.post.image is empty %}{{uc_assets_url}}/no-image.png{% else %}{{item.post.image}}{% endif %}); background-size:cover; background-position:center; height:{{image_height}}px;"></div></a>
      </div>

      <div class="uc_image_carousel_content" >
        {% if show_category == "true" %}<div class="ue_post_category"><a href="{{item.post.category_link}}">{{item.post.category_slug}}</a></div>{% endif %}
        {% if show_title == "true" %}<h2 style:="text-align: center" class="card_carousel_title">{{current_post.item.title|raw}}</h2>{% endif %}
        {% if show_intro == "true" %}<p class="card_carousel_text"><b><span aria-hidden="true" class="fas fa-search-dollar"></span> Fonte:</b> {{current_post.cf_fonte_de_captacao|raw}}</p>{% endif %}
        {% if show_intro == "true" %}<p class="card_carousel_text"><b><span aria-hidden="true" class="far fa-money-bill-alt"></span> Valor do Projeto:</b> R$ {{current_post.cf_valor|raw}}</p>{% endif %}
        {% if show_intro == "true" %}<p class="card_carousel_text"><b><span aria-hidden="true" class="far fa-file-alt"></span> Pronac:</b> {{current_post.cf_pronac|raw}}</p>{% endif %}
     
        {% if show_button == "true" %}<div class="ue_post_btn_holder"><a class="uc_more_btn"  href="{{item.post.link}}">{{read_txt|raw}}</a></div>{% endif %}
      </div>
    </div>


  •  1,173
  • Valderes Zimmer replied

    Thanks for your reply, Amit. Your solutions works, but only in Pro version. I have a free license :-(
    There is any another field setup that I can use?

  •  1,173
    Amit replied

    no this is a pro feature

  • Valderes Zimmer replied

    Works fine (native fields):

    • {{item.post.link}} 
    • {{item.post.image}}
    • {{item.post.title|raw}}

    Custom post fields dn't work:

    •  {{item.post.fonte_de_captacao|raw}}
    • {{item.post.valor|raw}}
    • {{item.post.pronac|raw}}
  •  1,173
    Amit replied

    because you need to mark the check box otherwise the query does not occur . 


  • Valderes Zimmer replied

    Oh. Ok. And cunstom fiels only works in pro version. Now I undestand. Thanks, Amit.