I'm trying to display a content template above the Archive Loop using the block editor. The content appears in the preview within the editor, but it does not appear on the page itself.
Please see this video:
lien caché
I've deactivated all plugins (including the remaining two shown in the video). And the same behaviour happens with the 2020 Theme.
Thanks
Hi Alex,
Thanks for asking! I'd be happy to help.
This issue is already highlighted and when a content template is used outside the loop of a WordPress Archive, no current post/page scope is available due to which content template fails to render.
( ref: https://toolset.com/errata/content-template-is-not-rendered-if-added-outside-the-archive-loop-of-a-view/ )
A fix for this is planned to be released in Views version 3.3 and for now, a workaround can be to include any post/page ID through the "item" attribute.
Example:
[wpv-post-body view_template="slug-of-content-template" item="2"]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thanks, Waqar
My searches didn't find that reference to the problem. But on the other hand, the "workaround" proposed there didn't mention your suggestion - which works perfectly.
Thanks.
Alex
My issue is resolved now. Thank you!