Not sure how to explain this in a simple way but with the attached image, I hope the following makes sense.
The site is a real estate site and in the property page template I have a Toolset view that shows in a 4x2 grid the last 7 properties added to the site in the same destination as the property featured on the property page.
What I want to do is to add a terms field, eg [types termmeta='destinations-image' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types], to the view loop editor so that the last slot in the grid always show the destinations image for the same destination that the previous images are related to.
The problem is that I do not know where in the loop editor to enter the short code.
The loop editor code is as follows
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="4" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-most-recent-properties-view-test"]</div>
[wpv-item index=other]
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-most-recent-properties-view-test"]</div>
[wpv-item index=4]
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-most-recent-properties-view-test"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-3"></div>
[wpv-item index=pad-last]
<div class="col-sm-3"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found] [wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
'Destination' is a taxonomy linked to a custom post type.
I have attached an image visualising what I want to achieve and you can view the site at hidden link (scroll down to the bottom of the page)
The site is password protected - login details are
user: tga
pw: Krit@45
Best regards / john
Hello. Thank you for contacting the Toolset support.
Well - At the moment, you can display term fields on a View listing terms and on a term archive page.
To display the custom term field, what you should do it create a taxonomy view and within that taxonomy, view add the term field you want to display and add this view inside your post view where you want to display the term field.
Hi Minesh,
Thank you for your response. The problem is slightly different. I know how to display term fields - but what I do not know is how to integrate the term field with the other details in the loop editor view, ie how to display the term field (image) in the empty 8th slot in the 4x2 grid as per the image (attaching that again for clarity). Also, the image should be linked so when clicking on the terms field image in the 8th slot, it will take you to the relevant archive page.
Best regards/john
Hi Minesh,
Thank you for your message. Following your advice, I can display the taxonomy term field (image) - but not at the same time as the post types images.
I guess the problem may be that the system only allows me to display EITHER taxonomy fields OR post type fields - but not both in the same view. Is that assumption correct or is there a way around this?
Best regards/john
What you should do is create a taxonomy view and filter it by your taxonomy term and add whatever term custom fields you want to display to it and then, later on, add this newly created taxonomy view just after the pad-last statement.
Hi Minesh,
Thanks - works perfect. A final question with regards to this ticket.
The grid is 4x2, ie there are 8 slots. In cases where there are not fewer than eight posts to display in the grid, is there a way to make the 'last image' appear next to the last post? I tried [wpv-item index=pad] which kind of does the trick - the problem here is that the image is repeated so it fills all empty slots instead of just the first empty slot. I have attached an image for illustration purposes.
Best regards / john
Hi Minesh,
Thanks, will stick to pad-last.
However, I just noted that this solution brings another issue and I am not sure if this is a problem for you or for Elementor (the theme). The problem is that this code is affecting the width of some of the columns in the footer - I have attached two images, the property page where 'pad-last' is part of the template and an archive page where 'pad last' is not used.
You can also view the live pages on the following links (the site is password protected; user:tga, pw: Krit@45 ) hidden link hidden link
Best regards / john