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

Custom Posts Grid via ACF Relationship Field

Sridhar Katakam

This members-only tutorial provides the steps to output 3 (manually) related or associated posts for a Page set via ACF Relationship Field such that the first one has a different HTML output compared to the other two.

Step 1

Create a field group having a Relationship type of custom field.

Step 2

Edit your Pages and select the associated Posts for each.

Step 3

Let's define a custom function that outputs the excerpt given a post ID in the specified length.

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: Custom excerpt length

Code:

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