[Resolved] Adding non-repeating content on a custom archive
This thread is resolved. Here is a description of the problem and solution.
Problem:
Client has a custom WordPress archive, and wants to add some content at the top of the page before the archive loop results.
Solution:
The Loop Output section of the custom archive (and, likewise, a View) is just HTML (with lots of shortcodes that will generate more HTML). The part in between the wpv-loop tags will contain the archive results, but you can place additional markup outside of these, e.g. after the wpv-layout-start shortcode.
This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I found myself struggling with creating an archive template for a custom post type, which I defined with Toolset.
As I use the Divi Theme, I followed the instruction, which is linked below. I managed to design the display of the WordPress Loop on the archive page without any further problems.
My question now is: How can I proceed to design an additional section above the WordPress Loop Section to show e.g. an advertising banner or an e-mail subscription form using the divi builder? Unfortunately, all my efforts have yet ended with the display of the additional section above every custom post within the archive loop...
Yours may look different depending on the output format you choose using the Loop Wizard.
The key point is that everything inside the wpv-loop tags will be repeated for every post in the archive (in this case the linked template, which you are designing with Divi).
You can edit the above markup to include extra content. Whatever is outside the wpv-loop tags will be shown only once.
If you want something to appear above the archive results you could insert a DIV with whatever content immediately after the wpv-layout-start shortcode for it to appear in all case, or immediately after the wpv-items-found shortcode for it to appear only when there are results to show.
Note that you are inserting HTML markup here (which can include Types and Views shortcodes), you are not designing this part with Divi.