Get Custom Field Value of POST

There is wordpress function get_post_meta, used to get custom field value of post.

<?php $meta_values = get_post_meta( $post_id, $key, $single ); ?>

$post_id is POST ID which you can get in loop. If you are not using default loop of wordpress then use global $post and then you can find post id value through $post->ID.
$key is for custom field name which you were insert from admin or code.
$single is optional. If set to true then the function will return a single result, as a string. If false, or not set, then the function returns an array of the custom fields.

Key is featured_image then

 get_post_meta( $post_id, ‘featured_image’ );

Why would WordPress throw a 404 error on a POST form submit in template

I was working on a WordPress project when I face this problem. It’s not any big deal. I have a form in custom template with 5 fields. But when I clicked on the submit button it shown 404 errors. So then I found that if you are using $_POST, $_GET or $_REQUEST with a post or get method in form the first check form fields name.
Eg. You have 2 fields with a username and email. These names used by WordPress. So just change the name and id of fields and then try to submit the form. It’s just simple.