I got a metabox that hold a monthly budget per client...
that meta box is inside a custom post type called clients.
Inside that metabox the only thing entered is numbers.
I want to get the sum of all the clients.
Any ideas?
Altough i think its pure php.. somehow using foreach - to the request of @Fahd Murtaza i am trying to add parts of my metabox... i am using alchemy as the base to create my meta boxes so would add some parts.. Hope this doesnt confuse more..
<?php
// structure of my metabox usign alchemy
$clients = new WPAlchemy_MetaBox(array
(
'id' => '_project_description',
'title' => __('Client Info Card', 'sagive'),
'template' => get_stylesheet_directory() . '/metaboxes/clients-meta.php',
'types' => array('portfolio'),
'context' => 'normal',
'priority' => 'high',
'autosave' => TRUE
));
.
// call for budget section in my meta box
<p>
<label><?php _e('Clients Budget:', 'sagive'); ?></label>
<?php $mb->the_field('client_budget'); ?>
<input type="text" name="<?php $metabox->the_name('client_budget'); ?>" value="<?php $metabox->the_value('client_budget'); ?>"/>
</p>
.
The rest of the code is way to long and i think not relevant to show... correct me if i am wrong and would add it via pastebin or similer..
.
THIS IS HOW I QUERY THE POSTS...
<?php
query_posts(array(
'post_type' => 'portfolio',
'showposts' => 10
) );
$count_posts_portfolio = wp_count_posts( 'portfolio' )->publish;
?>