Public Ticket #2754718 how to show dynamic content of custom fields from custom post ype in a carousel Closed
Comments Valderes Zimmer started the conversationApril 19, 2021 at 5:19pmI 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,194Amit repliedApril 19, 2021 at 5:35pmhttps://www.loom.com/share/3d7fa7240053477aa50936cdf0573829Valderes Zimmer repliedApril 19, 2021 at 5:46pmThanks 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,194Amit repliedApril 19, 2021 at 5:53pmno this is a pro featureValderes Zimmer repliedApril 19, 2021 at 6:01pmWorks 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,194Amit repliedApril 19, 2021 at 6:03pmbecause you need to mark the check box otherwise the query does not occur . Valderes Zimmer repliedApril 19, 2021 at 6:27pmOh. Ok. And cunstom fiels only works in pro version. Now I undestand. Thanks, Amit. Sign in to reply ...
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>
https://www.loom.com/share/3d7fa7240053477aa50936cdf0573829
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?
no this is a pro feature
Works fine (native fields):
Custom post fields dn't work:
because you need to mark the check box otherwise the query does not occur .
Oh. Ok. And cunstom fiels only works in pro version. Now I undestand. Thanks, Amit.