[ad_1]
Is there a way to put a function call or some sort of variable in a synced pattern so that the title of the post in which the pattern is being displayed is outputted?
For example, if I make a pattern that says ‘This is a post about %title%.’. In a post with the title ‘Monkeys’, the pattern would display ‘This is a post about Monkeys.’
I would really appreciate any help on this. I may be missing the right terminology which is preventing me from finding the answer myself with Google…
[ad_2]
There are a few ways to do this:
1) “proper method” [https://developer.wordpress.org/reference/hooks/pre_get_document_title/])
2) Edit your theme’s page template and simply add the text where you want it to appear. You can find out the name of the template via a plugin called Query Monitor. Note that any changes to theme templates need to be done in a child theme.