ACF Data - Single Page Query Loop

Hi,

im relatively new to WP and bricks, i tried to solve this task for days but can’t do it:

  • I have ACF fields for entering partner companies
  • I want to have a single page for each company, after putting in the individual ACF data a new page should automatically be created (like ACF query loop) (just to view for the user, company does NOT have to have editing access or something)
  • until now i am just able to do query loops inside a block, with single post page template tutorials i didn’t get nowhere
  • just to tell you where i plan on going: later those company pages should get connected to single item pages and/or information pages (which should follow the same system) and pinned on an overview open street map

Thank you in advance for every help

Philip

You need a single post template. That’s 1 design that repeats for all single posts of that posttype.

Where a query puts many posts in 1 list, a single post template displays just 1 post.

Go into Wordpress menu, Bricks, Templates, Add template, Select Single as post template type on the right side column

Then in Bricks builder add a template condition like so where bedrijf is the posttype the template is for.

So you don’t need a query on a single post template.

You use a query to list all single posts into a list where a user can select one to open the single post template.

1 Like

thank you ferry, i’m getting somewhere.

I realizied it worked when i put in the url for the post in the browser.

what irritated me though is that in the template editor it says ‘dynamic data empty‘ and ‘no post found’, and even in the bricks preview just the template title shows up
Is that normal?

edit: also is it necessary to set the ‘populate content’ below the ‘conditions’

There’s this option to load the data into it. Under the manage (gear icon left top) template settings, populate content

Should do the trick

For the template just showing the title, it needs to be designed. Not sure if you use just Wordpress fields or custom fields like acf but you should take like an text element and assign content to it.

Same for custom fields that can be loaded by dynamic data (lightning icon) you take an element to display in, and then assign whats needs to be in there.

So for a normal wordpress post you have

Image element - assign featured image

text element - assign content

excerpt - textelement- assign excerpt

ect.

thank you a lot for your help and explaning the basic stuff to me :slight_smile:

i think what you described is what i am already doing.

i think i got it now and it seems to work like the following:

  • while in the template editor all dynamic data stays empty (‘dynamic data empty’ shown in the elements)
  • except when you populate it
  • without populating the ‘post title’ element shows the template title in the bricks preview
  • to populate the content you have to choose ‘single (post..)’ and then SEARCH for the post because it doesnt necessarily show up in the dropdown
  • when you delete the populate content, the content STAYS in the template editor and bricks preview, even after saving and refreshing (thats what also irritated me because to learn causataion i tend to delete the setting i think is responsible :slight_smile: )
  • no matter if you populate it or not, if you put the post url into the browser it should work as soon as you set the condition

thanks again for your help my friend!