Dynamic Field Sorting for Wordpress ACF

by John H
~1 minute
Screen Shot 2016-08-24 at 10.34.31 AM

A site my employer has uses the Advance Custom Fields plugin for Wordpress. They use the plugin to create custom post types which they use for creating product pages. This plugin allows you to create fields that are attached to the custom post type and gives users the ability to enter posts with custom fields. The job here was to create pages that list out, or filter, product posts based on the value of the custom fields.

The issue was that the two fields, "Categories" and "Sub Categories" didn't have any correlation other than the products they were attached to. In other words, I wasn't able to actually pull what sub categories were associated with categories because these fields weren't tied together. The solution involved loading up temporary arrays and sorting and filtering those arrays.

The result was a page that allows sorting based on url variables

Related Articles

Feedback Dashboard using Vue.js For Wordpress

I just completed a Feedback system for monitoring if a FAQ post was helpful or not. Every post...

John H John H
4 minutes

Hreflang System for Wordpress

HrefLang Class This class handles buidling the href lang tags across all of out international...

John H John H
4 minutes

Selling to the World - Contact form

Created Contact form template for Wordpress. Form mails the admin. PHP, HTML, CSS. March 2014...

John H John H
~1 minute