> For the complete documentation index, see [llms.txt](https://wplake.gitbook.io/advanced-views/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wplake.gitbook.io/advanced-views/integrations/themes/classic/displaying-custom-fields.md).

# Displaying custom fields in Classic themes

Using [*Layouts*](/advanced-views/getting-started/first-layout.md) from Advanced Views, you can display any custom fields in [classic themes](https://developer.wordpress.org/themes/classic-themes/basics/template-files/). Smart templates [give you complete control](/advanced-views/getting-started/key-aspects.md) over the markup and display logic without extra hassle. &#x20;

{% hint style="success" %}
Advanced Views natively supports fields from multiple providers:

1. [WordPress fields](/advanced-views/fields/wordpress-fields.md) (like page title, excerpt, user name, etc)
2. [Advanced Custom Fields](/advanced-views/fields/meta-plugins/advanced-custom-fields.md) (any field type)
3. [MetaBox fields](/advanced-views/fields/meta-plugins/meta-box-fields.md) (any field type)
4. [Pods fields](/advanced-views/fields/meta-plugins/pods-fields.md) (any field type)
5. [WooCommerce Product fields](/advanced-views/fields/woo-product-fields.md) (like price, SKU, height, etc)

To display [other fields](/advanced-views/fields/other-fields.md) made by your theme or plugins, just [customize the default Layout template](/advanced-views/layouts/code-fields/custom-template.md).
{% endhint %}

Displaying custom fields in classic themes with Advanced Views offers a row of advantages over manually rendering them via [get\_post\_meta()](https://developer.wordpress.org/reference/functions/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](/advanced-views/features/workflow/template-validation.md) – 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](/advanced-views/layouts/code-fields/css-code.md) and [JavaScript](/advanced-views/layouts/code-fields/javascript-code.md) – 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](/advanced-views/features/file-system-storage.md), you get the best of both worlds: [smart templates](/advanced-views/features/smart-templates.md) 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.&#x20;

### 1.1) on a single page

You can embed a L*ayout* using your editor: check the specific [Classic editor](/advanced-views/integrations/editors/classic/displaying-custom-fields.md) or [Gutenberg editor](/advanced-views/integrations/editors/gutenberg/displaying-custom-fields.md) 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.&#x20;

You can embed *Layouts* in any of these templates:

1. [Create a *Layout*](/advanced-views/getting-started/first-layout.md)
2. Add target fields in the *Fields* tab and save the *Layout*
3. Copy a [Layout embedding shortcode](/advanced-views/layouts/embedding-shortcode.md)
4. Open the target [page template](https://developer.wordpress.org/themes/classic-themes/basics/template-files/) (e.g. `single-{post-type}.php`)&#x20;
5. Embed the *Layout* shortcode: `<?php echo do_shortcode('YOUR_SHORTCODE'); ?>`
6. 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.

{% hint style="success" %}
*Layout* IDs are unique string identifiers, not WordPress post IDs. Unlike post IDs, they remain unchanged when *Layouts* are exported and imported, ensuring consistent references across different environments, such as staging and production.
{% endhint %}
