4.0Essential Grid 4.0 is here — see what’s new

FAQ

How to get a Full List of your Post’s Meta Data

Essential Grid 3 · The 4.0 FAQ

If you’re setting up a Meta Reference, but this isn’t showing up in your grid, the following tip can help to make sure the “Original Handle” being used is correct. This is useful for WooCommerce, Events Manager, and other CPT’s.

1. Temporarily add the following code snippet to your theme’s “functions.php” file.

function my_post_meta( $content ) {
 
    $my_meta = get_post_meta( get_the_ID() );
    $my_meta_data = '<pre>' . print_r( $my_meta, true ) . '</pre>';
 
    return $content . $my_meta_data;
 
}
 
if( !is_admin() ) {
 
    add_filter( 'the_content', 'my_post_meta' );
 
}

2. View one of your posts, pages or products on the front-end of your site.

The Meta Data will then be shown toward the bottom of the page and look something like the screenshot here:

In the screenshot to the right, the “Original Handle” for “Total Sales” is:

total_sales

and the “Original Handle” for “Sale Price” is:

_sale_price
Black Friday

30% off your first year of Essential GridBlack Friday: 30% off Until Ends tonight

See the offer