Forum Replies Created
-
AuthorPosts
-
March 23, 2023 at 12:34 AM in reply to: MB custom fields and WP Gridbuilder data issue on filter facet #41176
Bolo Duong
ParticipantI have tried this code but doesn't output any change
$price = get_post_meta( get_the_ID(), 'price', true ); // Get the value of the custom field
$formatted_price = number_format( $price, 2, '.', ',' ); // Format the value with commas
echo $formatted_price; // Output the formatted valueMarch 22, 2023 at 10:10 PM in reply to: MB custom fields and WP Gridbuilder data issue on filter facet #41174Bolo Duong
ParticipantHi Peter,
Thanks for your support. I tried the multitask plugin, but it seems is not updated and is was causing some wrong behaviors at the meta box, like hiding some elements, etc.
I found this solution and seems it works
function format_my_number($atts) {
$num = $atts["value"];return number_format($num, 0, '.', ',');
}
add_shortcode("custom-number-format", "format_my_number");But I need to add a shortcode and type the value. There is a way I can call my value, from the number field
[custom-number-format value=""]
Can you help guide me with some code I would really appreciate it
https://www.berrycast.com/conversations/783bd92c-92a4-5e1d-8075-fc7e1e599608
March 21, 2023 at 5:20 AM in reply to: MB custom fields and WP Gridbuilder data issue on filter facet #41136Bolo Duong
ParticipantHi Peter, thanks a lot for your support, now my site is not crashing but the codes seem not working, and not formatting my number price field.
Here I show you a video of my process. Again thanks =)
https://www.berrycast.com/conversations/a45db345-9f58-5c98-b0bf-176f5b89f0a1
March 17, 2023 at 11:21 PM in reply to: MB custom fields and WP Gridbuilder data issue on filter facet #41070Bolo Duong
ParticipantHi Peter,
Thanks for your soon support. When Added the code it cratch my site, here is a video of what I'm trying to achieve, thanks a lot
https://www.berrycast.com/conversations/2dca75e0-08bc-5f5f-a95d-1ad9b819a4b4
Best Regards
March 16, 2023 at 11:38 PM in reply to: MB custom fields and WP Gridbuilder data issue on filter facet #41058Bolo Duong
ParticipantHi, Peter thanks for your soon answer. Do you have any code snippet I can use to format the number on the front? I used this one but seems it is not working
$number = rwmb_meta( 'price' );
// English notation
$english_format_number = number_format($number);
echo $english_format_number;Can you help me with this
Thanks for your support
-
AuthorPosts