Title: Insert Pages width ACF
Last modified: September 26, 2018

---

# Insert Pages width ACF

 *  Resolved [PashkaRu](https://wordpress.org/support/users/pashkaru/)
 * (@pashkaru)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/insert-pages-width-acf/)
 * problem with ACF plugin
 * if I write `echo do_shortcode("[insert page='300']");` , then all custom fields
   are displayed, if I additionally specify the template name, and write `echo do_shortcode("[
   insert page='300' display='mytmpl.php']");`, then custom fields are not displayed.
 * What am I doing wrong?
 * thanx!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * (@figureone)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/insert-pages-width-acf/#post-10794764)
 * In your custom `mytmpl.php`, you need to use the ACF functions to render any 
   ACF fields you want shown, such as `the_field( 'my-acf-field' );`.
 * Hope that helps!
 *  [ziemot](https://wordpress.org/support/users/ziemot/)
 * (@ziemot)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/insert-pages-width-acf/#post-11163582)
 * Hello,
 * I tried to do like you said above, but… it seems that there is some issue with
   id of the post that should be provided to the_field ACF function, let me explain
   my problem:
 * – if I use: [insert page=’post-name’ display=’my-template.php’] where my template
   is using the ACF function the_field(‘name_of_field’), nothing happend.
 * – if I use: [insert page=’post-name’ display=’all’] – I’ve got all fields that
   exists in my custom post type, so I assume that the post is available to read
   by Insert Pages plugin.
 * – if I use: [insert page=’post-name’ display=’my-template.php’] where my template
   is using the ACF function the_field(‘name_of_field’,’id-of-the-post’), so I added
   the post id to the ACF function – it works fine.
 * So, question is how to find and provide the post id to the ACF function in the
   template? Maybe it is simple 🙂 – I am not so familiar with coding in WordPress.
 * I am working with WordPress 5.0.3, Insert Pages ver. 3.4.3, ACF ver. 5.7.10 and
   Custom Post Type UI ver. 1.6.1 (+ template Iconic One Pro v. 2.4).
 * Best regards,
    Ziemowit
 *  Plugin Author [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * (@figureone)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/insert-pages-width-acf/#post-11167888)
 * Sounds like your custom template is missing the Loop…`the_post()` is the core
   function that populates the global $post variable that all the template functions
   rely on (including ACF’s `the_field()`).
    [https://developer.wordpress.org/reference/functions/the_post/](https://developer.wordpress.org/reference/functions/the_post/)
 * My custom templates look like:
 *     ```
       <?php /* Template Name: Your Template Name */ ?>
       <?php while ( have_posts() ) : the_post(); ?>
         ... the rest of your template content goes here ...
       <?php endwhile; wp_reset_postdata(); ?>
       ```
   
 *  [ziemot](https://wordpress.org/support/users/ziemot/)
 * (@ziemot)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/insert-pages-width-acf/#post-11168372)
 * Hello,
 * To tell the truth I did some workaround and used the function from your plugin,
   so my template does not use the Loop but only contains one line:
 * <?php the_field(‘<Name of the field>’, $inserted_page->ID); ?>
 * beside the first comments lines 😉
 * and it’s working :-).
 * Is it workaround or proper set up?
 * Best regards,
    Ziemowit.
 *  Plugin Author [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * (@figureone)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/insert-pages-width-acf/#post-11168622)
 * Your solution looks fine!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Insert Pages width ACF’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/insert-pages.svg)
 * [Insert Pages](https://wordpress.org/plugins/insert-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-pages/reviews/)

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)

 * 5 replies
 * 3 participants
 * Last reply from: [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/insert-pages-width-acf/#post-11168622)
 * Status: resolved