I’m tweaking a plugin for it to work for a website that I’m creating. The PHP code is stored at http://jsfiddle.net/zvN2p/ (I know, JSfiddle doesn’t work with PHP. Just a placeholder). Anyway, I’m focusing on what happens when the custom_field is set to true in the shortcode. There are two issues with the PHP code:
1- Sounds silly enough. I can’t get the counter to increment itself. It’s currently placed inside the foreach loop, but it doesn’t increment when the posts show. I have absolutely no idea why.
2- I can’t get the values of the custom fields using get_post_meta($post, $key, true), where $key is replaced with $index and $doc_no, the 2 instances of the custom field key name for whose value I wish to obtain. When I run it, it just show up empty. Could it have something to do with the key name being a Unicode character?
- The topic ‘Can't Get Custom Field Value’ is closed to new replies.