Skip Navigation

[Résolu] Content Template not appearing above Archive Loop

This support ticket is created Il y a 4 années et 1 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par alexG-4 Il y a 4 années et 1 mois.

Assisté par: Waqar.

Auteur
Publications
#1643561

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

#1646043

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

#1646639

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

#1646641

My issue is resolved now. Thank you!

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance