Links

Mount Points (Pro)

Mount Points allow you to add a View to a location that doesn’t support shortcodes and places that usually require editing PHP templates.

Step by step

  1. 1.
    Create your View and assign fields as usual. (See Creating an ACF View)
  2. 2.
    Switch to the Mount Points tab.
  3. 3.
    In the Specific posts field select which posts to limit the mount point to.
  4. 4.
    Or instead use the Post Types field to limit the mount point to all posts of the same type.
  5. 5.
    For the Mount Point first determine where you want to show your View, then add the Unique word, string or HTML piece to ‘Mount’ to. If left empty all the content will be used as a mount point.
  6. 6.
    In the Shortcode Arguments field add available arguments to your shortcode to restrict visibility or to define another object id.
Note: this feature uses 'the_content' theme hook, so mount points won't work if your theme or a specific template doesn't call it or calls it outside the standard loop (most of the themes do it right).

Watch the video

Custom theme template

If you’re going to create your own theme template, see below for a sample on the correct standard loop, you will have to use this as a basis in order for the Mount Points feature to work with pages that use your custom template files.
1
<?php
2
// even if your template is designed for a single page/CPT item
3
// you must use the loop, it's the default WordPress way
4
// (see default themes, like twentytwenty)
5
while ( have_posts() ) {
6
// it's a part of the loop, this call 'loads' data about the current post/CPT item
7
the_post();
8
9
// content can be printed either using the 'the_content()' function
10
the_content();
11
12
// or can be get using the 'get_the_content()' function,
13
// but only along with the "apply_filters( 'the_content', $content )" call
14
$content = get_the_content();
15
$content = apply_filters( 'the_content', $content );
16
17
// todo print post fields here
18
}