Using Bricks and ACF, I want to insert quotes from another post type into my blog posts (default WP “Posts” type)
Here is my current setup:
Custom Post Type: “Quotes”
With the field groups “quote_title”, “quote”, and “featured_in_posts”.
Default Wordpress “Posts” type,
With the added ACF field “quote_reference”.
This “quote_reference” field is set up as a bidirectional relationship field with “featured_in_posts”.
I have a bricks template set up to conditionally display only on “Posts” type,
And am using the Gutenberg editor to write the blog post, and then {post_content} to pull that through into the template.
Here are the things I need:
- The quotes are set up to be dynamic, so when they are updated on the “quotes” page the are updated on any pages on which they’re quoted.
- The bidirectional relationship lets me dynamically fill backlinks on the quotes pages, so that they automatically update to show what pages the quote is displayed on.
- I need to be able to insert the quotes inline, e.g:
"blog post content bla bla bla.
{acf_quote_title}
more blog post content. blaaaa.
{acf_quote}."
I’ve got part 1 and 2 sorted, but am not sure how to achieve 3. with my current setup.
To clarify, I want to be able to put the quote dynamically into the Gutenberg editor, inline.
{acf_quote} and {acf_quote_title} do not work because it is not from this post type. The only thing I’ve managed to pull through is {acf_quote_reference} which pulls through the Post ID of the Quote I have linked with the Blog Post.
Since they’re from another post type, linked with the acf relationship, I know I can pull them through using a query loop in the bricks template, but this would restrict where I can put them (I’ll not be able to put them in line in the Post Content), and also not allow me to specify which quote I want to pull through in blog posts which have multiple quotes attached? (or is there a way to do this?)
Ideally, I would like a no-code solution using the tools I currently have, but am open to using code so long as it is flexible and I don’t need to add something for every new quote I add onto the website.
Please let me know your suggestions. Thank you!