Search / filter a multilingual list of posts by languages
Started by: caroleM-4
in: Toolset Professional Support
Quick solution available
Problem:
What I would need is a condition that avoid the code running in the View blocks preview only but I did not find any until now.
Solution:
You can use function WP_Screen::is_block_editor() to check if it is the block editor is loading on the current screen, see WP document:
Relevant Documentation:
https://developer.wordpress.org/reference/classes/wp_screen/is_block_editor/
2
15
4 years, 1 month ago
caroleM-4
Comma format
Started by: rajivG
in: Toolset Professional Support
Quick solution available
Problem:
The issue here here is that the user wanted to format the output from their number field with a comma for every thousand.
Solution:
This is not something that can be done natively with our Toolset plugins and as such you will need to use a little bit of custom code to format the numbers.
I've written a simple custom shortcode below to format the numbers for you.
// Add Shortcode
function wp_format_number( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'number' => '',
),
$atts
);
return number_format($atts['number'],0,'.',',');
}
add_shortcode( 'wp_format_number', 'wp_format_number' );
Add it to your Toolset Custom Code section in Toolset->Settings->Custom Code and activate it.
Then you can simply use the shortcode like this [wp_format_number number='[wpv-items-count]']
Relevant Documentation:
2
3
4 years, 1 month ago
rajivG
Pagination (Links) display issues with Mobile
Started by: riccardoU
in: Toolset Professional Support
Quick solution available
Problem:
Setup pagination links block.
Solution:
You can find and select the Pagination block, setup it as what you want.
Relevant Documentation:
2
4
4 years, 1 month ago
riccardoU