In wordPress, while we add our posts into website, sometimes we need to add an extra information along with post in various parts. For instance, A post can contain selectable fields, input text fields and so on.
To add such kind of information with post we have am amazing solution provided by wordpress.
To add extra infoation with post we can use add_post_meta() function. This function contaims post id , post meta key, ( post meta key should unique for each time) and aary or no aary content .
We can get post id just after it created. So the use of Ajax it makes more reliable for programmers.
Get post meta
We can retrive saved post meta fields by as same as we previously added. Its little bit similar to save post meta function. We can use get_post _meta() function to retrive our post meta by using post id. Its very important to mention post meta key along with post id in this function to retrive our information