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

Displaying Image field

Advanced Views natively supports the following image types:

  1. WordPress: Post FeaturedImage field

  2. WooCommerce: Product FeaturedImage field

  3. ACF: any Image field

  4. MetaBox: any ImageSelect field

  5. Pods: any Image field

1. How to display an Image field

  1. Add any image field

  2. Save the Layout, copy its embedding shortcode

  3. Embed Layout: paste the shortcode inside the target place

Advanced Views automatically creates HTML markup and loads image metadata (like src, width, height) into the template.

You can customize the Layout template to use the Image render options.

2. Displaying Image in the cropped size

Default crop sizes are available for selection when assigning an image field in your Layout.

Visit the Advanced Views tab in WordPress backend.

Click on the Edit link or Title of your Layout to edit.

Click the Add Field button.

Select Post & Post fields (WordPress, WooCommerce) from the Group dropdown.

Select Featured Image field from the list or Select Featured Image with link. Or any other group and field that is an image field type.

An extra Field appears called Image Size, select the preferred image size from the list.

Click on the Update button to save and publish your Layout.

3. Displaying SVG images

By default, WordPress doesn't allow uploading .svg files into the Media Library. However, this can be configured using some dedicated plugin.

Advanced Views supports SVG out-of-the-box. As you may have seen, an ordinary image has the following markup by default:

This doesn't work for SVG, so Advanced Views provides a separate field property for SVG cases: svg_content. When you expect an SVG to appear, you should instead use:

This field contains the content of the SVG, so it will be placed on the page as an inline SVG image.

Why inline? Because only inline SVGs support color changes, allowing you to style it with CSS and even change the color on hover.

If you need to assign a class to the SVG element, you can use the following trick:

Last updated