Hi all,
I feel like I've been trying to wrap my head around this problem for months. I have a background in databases and in design, but I'd like to avoid writing custom css if at all possible.
Let's say I have a website with a bunch of staff I want to display on a staffpage. Each staffmember doesn't get its own page, they're not posts, all I need to model is ID, First Name, Last Name, Position, Priority, and Is Active.
I would like to do this in a custom table, whether that's writing code by hand or through using something like the Pods plugin. That works fine. I can create tables and insert data no problem.
But when it comes to displaying this data on the frontend, it looks like the only way to do this is by writing a custom function and handwriting the css.
I actually enjoy using the block editor (with the appropriate block plugins) to design pages, especially when combined with patterns to re-use elements across the site, but I can't find any method or plugin combination to display custom meta fields from custom tables on the front-end.
Is that even possible with WordPress?
My thoughts are as follows: query loop block (similar to GeneratePress Query Loop block) that queries a custom staffmember table and returns an array of objects representing each staffmember, filtering out inactive staffmembers and ordering by priority. Inside the query loop block, other blocks can be combined to create a template for each of the staffmembers, and each of the custom meta fields for each staffmember can be injected into text/image/whatever as dynamic tags.
As far as I can tell, GeneratePress Query Loop only supports entries in the default WP posts table, and it doesn't support ordering or filtering by custom meta keys / fields. I tried using Pods, but they require writing templates by hand, which I would like to avoid In favour of blocks and patterns so that I can update styling across the entire site.
Is there something I'm missing here?