Preview:
get_post_meta( int $post_id, string $key = '', bool $single = false )
Retrieves a post meta field for the given post ID.

Parameters
$post_id
(int) (Required) Post ID.

$key
(string) (Optional) The meta key to retrieve. By default, returns data for all keys.

Default value: ''

$single
(bool) (Optional) Whether to return a single value. This parameter has no effect if $key is not specified.

Default value: false

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter