robpanes-space / wpch_thermometer_plugin

0 stars 0 forks source link

Need shortcode for thermometer id values #1

Open webextra opened 11 years ago

webextra commented 11 years ago

Hi

We are trying this plugin for a school charity website. However I needed an easy method or a shortcode to access the values stored for each thermometer created.

This function will very helpful and allows the user to provide information in sentencing i.e. Total funds raised so far:

Thanks

robpanes-space commented 11 years ago

Oh So sorry about closing the issue. I think I got what you are talking. I will be updating the plugin tomorrow my zone. So hopefully I will include the ability to get the total amount of all the thermometer created.

webextra commented 11 years ago

Hi I noticed that this issues was closed does this mean that a fix or function is available? I am a novice, so please be patient. Thanks

robpanes-space commented 11 years ago

No it wasn't close, I accidentally pressed the close button. btw do you have any knowledge to use wordpress native API's? if so you can pull all the thermometer you created loop through the data and sum it all up.

Go to this link. http://codex.wordpress.org/Template_Tags/get_posts

Then on the 'post_type' => 'wpch_thermometer'. On the loop get each post_type id and grab the the postmeta _wpch_meta_current like so: $wpch_meta_current = get_post_meta($post->ID, '_wpch_meta_current', true);