Here is a link to the page that I need help with (screenshot is below for reference):
hidden link
Using Toolset and Views, I have created a list of Exhibitors. What I need is for the date at the top of the list to update automatically whenever a new exhibitor is added, so that those visiting the page will know how current the list is.
Thank you for your assistance,
CommMgr
Hi, there's not really a built-in way to display the latest update date for a View. Instead, you could create a second View that is filtered to show the same results, but ordered in descending chronological order by post date, and limited to only the first result. In the Loop editor of that View, insert the post date shortcode. Then insert this second View in the original View's table header. The nested View will output the date of the most recent matching post. Let me know if you have questions about this.
Hi, Christian...
Thank you for your quick reply. I am still rather new to views and coding the loops. So, yes, I will need help with how this code should be written. If you can instruct me on how to post my view code in this support thread, I will provide that to you as reference.
CommMgr
Okay sure, you can post your View's Loop Editor code here by surrounding it in code tags. Click "Formatting instructions" above the comment editor to see examples of code tags and some other allowed HTML.
However, its fairly straightforward and I will try to explain it step by step. Create a new View, and choose "full custom display" in the setup popup. This will open up all the editor panels in the new View editor screen for complete customization. Once you're in that editor screen, choose the correct post type in the Content Selection area, then in the Ordering section choose Post Date - Descending order. In the Limit and Offset section, choose a limit of 1 post and no offset. Scroll down to the Loop Editor panel and click "Skip wizard" to start with a basic loop structure. Then place your cursor between the wpv-loop tags and click "Fields and Views", then "Post Date". You can choose from different date formatting options, then the system will automatically insert the post date shortcode in the loop. That's all the code you need to write for this View.
Then edit the existing View with the table, place your cursor where you want the date to appear and click "Fields and Views". Choose your new View, and the system will insert a shortcode for you automatically.
Hi, Christian...
Thank you for the step by step instructions. I was able to create the date view and put it in my original view code and it works.
However, I have a display problem with the date I need your help with. The date view code makes the "date" go on a separate line. I need the date to be inline with the rest of the text (see screenshot for reference).
Your assistance is greatly appreciated...
CommMgr
My view code for reference:
[wpv-post-body view_template="conference template"][wpv-layout-start]
[wpv-items-found]
<table style="margin-bottom: 0;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody class="wpv-loop js-wpv-loop">
<tr>
<td style="border-style: solid none solid; border-top: none; border-bottom: thin solid #bfbfbf; font-size: 16px; line-height: 1.3em; padding-left: 10px;" width="67%" valign="middle" align="left">EXHIBITORS (as of [wpv-view name="exhibitor-list-la-date-updated" limit="1" orderby="date" order="desc"])</td>
<td style="border-style: none none solid; border-top: none; border-bottom: thin solid #bfbfbf; font-size: 16px; line-height: 1.3em" width="22%" valign="middle" align="center">AGENCY</td>
<td style="border-style: none none solid; border-top: none; border-bottom: thin solid #bfbfbf; font-size: 16px;" width="11%" valign="middle" align="center">BOOTH</td>
</tr>
<!-- wpv-loop-start -->
<wpv-loop>
<tr>
<td style="padding: 5px 0; border-top: none; border-bottom: thin solid #bfbfbf; font-size: 16px; line-height: 1.3em; padding-left: 10px;" valign="middle" align="left"><a href="[types field="web-site-url" raw="true"][/types]" target="_blank">[types field="exhibitor-full-name"][/types]</a></td>
<td style="padding: 5px 0; border-top: none; border-bottom: thin solid #bfbfbf; font-size: 16px; line-height: 1.3em; text-align: center;" valign="middle" align="center">[types field='california-lighting-sales' state="checked"]<a href="<em><u>hidden link</u></em>" target="blank"><img class="alignnone size-full" style="vertical-align: middle;" src="<em><u>hidden link</u></em>" alt="CLS" width="auto" height="30" /></a>[/types][types field='california-lighting-sales' state="unchecked"][/types][types field='dsa-lighting' state="checked"]<a href="<em><u>hidden link</u></em>" target="blank"><img class="alignnone size-full" style="vertical-align: middle;" src="<em><u>hidden link</u></em>" alt="DSA" width="auto" height="30" /></a>[/types][types field='dsa-lighting' state="unchecked"][/types][types field='forman-and-associates' state="checked"]<a href="<em><u>hidden link</u></em>" target="blank"><img class="alignnone size-full" style="vertical-align: middle;" src="<em><u>hidden link</u></em>" alt="FA" width="auto" height="30" /></a>[/types][types field='forman-and-associates' state="unchecked"][/types][types field='light' state="checked"]<a href="<em><u>hidden link</u></em>" target="blank"><img class="alignnone size-full" style="vertical-align: middle;" src="<em><u>hidden link</u></em>" alt="L" width="auto" height="30" /></a>[/types][types field='light' state="unchecked"][/types][types field='performance-lighting-systems' state="checked"]<a href="<em><u>hidden link</u></em>" target="blank"><img class="alignnone size-full" style="vertical-align: middle;" src="<em><u>hidden link</u></em>" alt="PLS" width="auto" height="30" /></a>[/types][types field='performance-lighting-systems' state="unchecked"][/types][types field='plp-socal' state="checked"]<a href="<em><u>hidden link</u></em>" target="blank"><img class="alignnone size-full" style="vertical-align: middle;" src="<em><u>hidden link</u></em>" alt="PLP" width="auto" height="30" /></a>[/types][types field='plp-socal' state="unchecked"][/types][types field='total-lighting-concepts' state="checked"]<a href="<em><u>hidden link</u></em>" target="blank"><img class="alignnone size-full" style="vertical-align: middle;" src="<em><u>hidden link</u></em>" alt="TLC" width="auto" height="30" /></a>[/types][types field='total-lighting-concepts' state="unchecked"][/types]</td>
<td style="padding: 5px 0; border-top: none; border-bottom: thin solid #bfbfbf; font-size: 16px; line-height: 1.3em;" width="11%" valign="middle" align="center">[wpv-conditional if="( $(wpcf-booth-number) ne '' )"][types field="booth-number"][/types][/wpv-conditional]</td>
</tr>
</wpv-loop> <!-- wpv-loop-end -->
</tbody>
</table>
[/wpv-items-found]
[wpv-layout-end]
Try the checkbox in the View editor that says "Disable the wrapping DIV around the View". It's just below the Loop editor. If that doesn't work, you can move the "EXHIBITORS as of(...)" text inside the nested View so it's all output together with the date.
The "Disable the wrapping DIV around the View" worked.
THANK YOU SO MUCH!
CommMgr