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

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
How to get a Full List of your Post’s Meta Data

The Author

KC

Strength does not come from winning. Your struggles develop your strengths. When you go through hardships and decide not to surrender, that is strength.

Liked this Post?
Please Share it!

[tp_popular title="Popular Grids" regex="(grids|template_library)" count=3]

Newsletter

Join over 25.000 others on the Essential Grid and Slider Revolution email list to get access to the latest news and exclusive content.