Hi!
Thanks for reaching out!
Unfortunately, we don’t have an option for this. Indeed you’ll probably need a custom query if this isn’t as simple as multiplying the number of events by a fixed number.
If you do have this information somewhere (your league tables, for example), it’s probably easier to display the entire table and use a simple JS code to retrieve values from that table and remove it (so users won’t see what is going on).
Thanks!
Hi Roch,
Thanks for the reply!
The code I’ve got is below – it loops through each published event and adds the scores together – the only thing missing is how to reference the home team score and the away team score for the post. I was hoping it was something as simple as sp_result_home and sp_result_away but it doesn’t look like that’s possible. There must be a way to query them, because they show on the event result, but I can’t seem to find how to do it.
Any advice?
$args = array(
'post_type' => 'sp_event',
'status' => 'publish',
'posts_per_page'=>'-1'
);
$query_frames = new WP_Query($args);
$framescount = 0;
if( $query_frames->have_posts() ) :
while( $query_frames->have_posts() ) : $query_frames->the_post();
$homescore = ???;
$awayscore = ???;
$framescount = $framescount + $homescore + $awayscore;
endwhile;
endif;
echo $framescount;
wp_reset_query();
Hi!
Thanks for your reply.
Unfortunately, this kind of customization is beyond the scope of our support. But I’ll leave this open in case another user or dev has any input on this.
Thanks!