• Resolved Emily Rapport

    (@eatpaintchic)


    Hello, I wanted to create a pattern for social sharing links which I could use on all single posts via template. But – when I do this it shares the name of the pattern and not the current post. I am using a hybrid theme. Is it an issue with not using a block theme or just something I can’t do right now? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi @eatpaintchic,

    I just tested adding a Social Sharing Block to a pattern in the Twenty Twenty-Four theme. Then I added the pattern to the posts template and the links share the current post as expected. I tested using WordPress 6.6.

    Can you share a bit more about your setup, such as the WordPress version? If you are able to share the theme, that would be helpful as well.

    Thanks,
    Nick

    Thread Starter Emily Rapport

    (@eatpaintchic)

    Thanks for your reply Nick, I am using a custom hybrid theme based on Underscores. I just tested this again and I think the issue was all me. I have a function that will allow me to generate a shortcode for a pattern so I can use it in a php template. I just tried it again as a general template (not a pattern) and called that in my php file using block_template_part(‘single-social-share’) – this method worked as expected. I think my shortcode to display a synced pattern is doing something else to the content of the blocks… but I’m not sure what (yet)…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using a pattern in a template’ is closed to new replies.