12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Jun 5, 2022

Meta Box Group Image Field in Custom Size

Sridhar Katakam

In the past, we showed how a Meta Box Group field's sub fields can be output manually using code here.

When an image field is retrieved either using the Oxygen's integration or manually, by default it is going to get the image in thumbnail size. In a practical scenario, we should be able to specify the image size. This members-only tutorial provides the steps to manually output an Image Advanced-type (can be any other image type of Meta Box field) of custom field's value in the specified image size (medium_large).

Backend (when a Page is being edited):

Front end:

Note 1: We are going to pull only the first image

Note 2

While the steps show how to do this in Oxygen, this can just easily be applied in any WordPress site.

Step 1

Create a field group and specify the Location (Page, Post etc.).

Add a Group-type of field having a WYSIWYG Editor and Image Advanced type of fields.

Here's the json file from our test site if you would like to import to follow along.

Step 2

Edit your Page(s) and populate the field(s).

Step 3

Edit the Page with Oxygen and add a Code Block.

PHP & HTML:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right