I’m working on a site whereby there is a simple template for a certain page in the site.
The page in question is an About Us page.
On the page there is the first main WordPress loop which just spits out the standard content of the main Wysiwyg field.
Underneath that the template has some code which spits out a loop of a custom post type called Staff. This custom post type has information on each staff member and each one is spat out there.
What I have added to the page via the backend is an Advanced Custom Field using ACF Pro. The field is called Our Story (our_story) and I’d like to be able to spit that field out on the template underneath all the staff members.
If I place the following code :
<p><?php the_field('our_story') ?></p>
into the template in the main WordPress loop which is at the start of the template then it shows up fine but I effectively want to start the same loop again but underneath the loops which have spat out the staff members.
If I copy the exact same loop which is at the start of the template to the end of the template then I don’t get anything output on the page where that code is. Do I therefore need to reset the code or something or is there an easy way of perhaps caching field content and placing it elsewhere in the template?
Many thanks for any help with this.
Read more here: How to re-use initial page content loop in WordPress?