Skip to content

Instantly share code, notes, and snippets.

@rayflores
Created February 19, 2019 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayflores/877a0d9b9c2417f747df815e9bbafb7d to your computer and use it in GitHub Desktop.
Save rayflores/877a0d9b9c2417f747df815e9bbafb7d to your computer and use it in GitHub Desktop.
html for custom sorted - indexed - list of postmeta that was a serialized json object to start.
<?php
/*
* Template Name: Custom List Page
*/
get_header();
$post_id = get_the_ID();
$meta_list = Sort_The_List::get_postmeta_from_db( $post_id );
if ( empty( $meta_list ) ) {
return;
}
?>
<section class="item-list">
<div class="item-list-wrapper">
<div class="items-table">
<table class="item-in-list">
<tbody>
<?php
foreach ( $meta_list as $key => $value ) {
printf( '<tr><th scope="row">%s</th><td>%s</td></tr>', $key, $value );
}
?>
</tbody>
</table>
</div>
</div>
</section>
<?php
get_sidebar();
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment