Ready to get started?Download WordPress


Can't Get Custom Field Value (2 posts)

  1. Angela
    Posted 3 years ago #


    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?


  2. Angela
    Posted 3 years ago #

    Anyone with some PHP out here?


Topic Closed

This topic has been closed to new replies.

About this Topic