• 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,

Viewing 1 replies (of 1 total)
  • Hey @mikehermary

    That’s very well possible with Timber and Twig.

    But it’s not only a Timber and Twig use case. Your first hurdle is probably to set up a custom permalink structure for your use case, which is more directly related to WordPress itself rather than Timber and Twig.

    You could use Routes, which might be easier to start with.

    Since we only rarely answer questions here in the support forum, I suggest you post your question on StackOverflow using the Timber tag. You might get more exposure there.

    Also, I would split your question into multiple smaller problems, because it would be a lot to expect of somebody to come up with complete code example for your use case.

Viewing 1 replies (of 1 total)
  • The topic ‘Display post content using two different single.twig files’ is closed to new replies.