For the complete documentation index, see llms.txt. This page is also available as Markdown.

Displaying custom fields in Classic themes

Using Layouts from Advanced Views, you can display any custom fields in classic themes. Smart templates give you complete control over the markup and display logic without extra hassle.

Displaying custom fields in classic themes with Advanced Views offers a row of advantages over manually rendering them via get_post_meta():

  1. Variable loading – you don't need to consult the ACF or Meta Box documentation to determine field return types or manually convert IDs into template-ready values.

  2. Template validation – if you modify or remove fields used by a Layout, Advanced Views automatically detects the changes and notifies you which Layouts require attention.

  3. Modular CSS and JavaScript – each Layout has its own CSS and JavaScript files, which are loaded only on pages where that Layout is rendered. This helps keep your global style.css and scripts tiny and improves page speed.

With the File Storage support, you get the best of both worlds: smart templates are stored as files, allowing you to edit them directly in your IDE and manage them with Git.

1. How to display custom fields

In Advanced Views, Layouts are embedded using native WordPress shortcodes.

1.1) on a single page

You can embed a Layout using your editor: check the specific Classic editor or Gutenberg editor guides.

2.2) In a Template

Classic themes consist of PHP templates that control every part of the site's output, including single pages, archives, the header, and the footer.

You can embed Layouts in any of these templates:

  1. Add target fields in the Fields tab and save the Layout

  2. Open the target page template (e.g. single-{post-type}.php)

  3. Embed the Layout shortcode: <?php echo do_shortcode('YOUR_SHORTCODE'); ?>

  4. Open the target page to see the result

When the template is rendered, the embedded Layout automatically displays the custom fields for the current page, post, or other content item using that template.

Last updated