Hi,
I have a query, please.
I have [wpv-found-count] showing the number of listings.
Just next to it, I want a column that will do this calculation:
[wpv-found-count] X 7, i.e., the count multiplied by 7
Would you please advise how to get this done?
Thanks,
Rajiv
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Rajiv,
Thank you for getting in touch.
Will this be a case where the [wpv-found-count] will always be multiplied by 7?
Please let me know so that we can know how to best proceed.
Thanks,
Shane
Yes.
The [wpv-found-count] will always be multiplied by 7, suffixed with 'questions'.
My final output will be, for example, 140 questions, 210 questions, 14,000 questions, 7,000 questions, etc.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Rajiv,
You should now be able to use this shortcode that I just created.
// Add Shortcode
function wp_multiply_seven( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'val' => '',
),
$atts
);
return $atts['val']*7;
}
add_shortcode( 'wp_multiply_seven', 'wp_multiply_seven' );
Add it to the Toolset custom code section at Toolset -> Settings -> Custom Code then activate it once you've saved it.
To trigger the shortcode you will need to do it like this.
[wp_multiply_seven val='[wpv-found-count]']
This should return the found count multiplied by 7.
Thanks,
Shane
It works beautifully. Thank you so much, Shane. Appreciated !