Display post content using two different single.twig files
-
Hello,
I have a requirement to display post content two different ways on my client’s website.
The first would display the title, featured image, content, and tags using this permalink structure: /stories/world/bordeaux/. This structure would use the default single.twig file.
The second would display the title, featured image, and Advanced Custom Field’s gallery field using this permalink structure: /photos/world/bordeaux. This structure would use the single-gallery.twig file.
The Bordeaux item would be sourced from the same story post in WordPress. It would just be the template that displays it differently depending on the permalink used to access it.
I know this would lead to the potential of duplicate content, but my client would like to display the galleries attached to each of their stories on a separate page from the main text content.
Is there anyway of achieving this with Timber and Twig templates?
Cheers,
- The topic ‘Display post content using two different single.twig files’ is closed to new replies.