How do I create an archive page as a <table> including metadata?
I'm really struggling getting this seemingly simple thing to work. I have a list of vendors as a CPT. They have metadata like contact name and last invoice date. I'd like to have the archive page for these vendors show a simple table:
Name | Contact name | Last Invoice |
---|---|---|
Joe's Plumbing | Joe Anderson | March 31, 2021 |
I can not seem to figure out how to get metadata into this. I'm also struggling with getting Wordpress to stop inserting h2
s, but at least I can style around that!
!-- wp:template-part {slug:header, tagName:header} /--
section class=wp-block-query inner-width content
table
!-- wp:query {query:{perPage:1000,pages:0,offset:0,postType:vendor,categoryIds:[],tagIds:[],order:asc,orderBy:title,author:,search:,exclude:[],sticky:,inherit:true},tagName:main,align:wide,layout:{inherit:false}} --
!-- wp:post-template {align:wide} --
tr
td!-- wp:post-title {isLink:true} /--/td
tdContact/td
tdLast Invoice Date/td
/tr
!-- /wp:post-template --
!-- /wp:query --
/table
/section
!-- wp:template-part {slug:footer, tagName:footer} /-→
How can I make tdContact/td
the actual contact's name (meta data name contact
)? I've seen other solutions using PHP, but when I do that on the HTML page it doesn't work. Maybe I followed the wrong guide?
Topic meta-value post-meta custom-post-types Wordpress
Category Web