Store metadata in variables or an array
-
Hi everyone,
Could someone please help me with the get_post_meta() function? I read the manual but it’s a little meager when it comes to PHP functions and my OOP knowledge is not good enough (yet).
I’d like to fetch data from the custom fields for every post using get_post_meta($post->ID, $key, $single); and save each value into a variable. Eventually i want to echo the data on certain places depending on the content.
I tried several things but i always get empty echo/print_r. The solution is probably very easy but i can’t seem to find it.
I can rewrite this function in PHP using a new MySQL-connection, but i prefer to use the standard functions and connections instead so the site stays fast.
- The topic ‘Store metadata in variables or an array’ is closed to new replies.