Problem displaying images, videos and date format in French
- This topic has 8 replies, 2 voices, and was last updated 3 years ago by
Long Nguyen.
-
AuthorPosts
-
March 18, 2022 at 4:57 AM #34586
Pierre
ParticipantHi,
I can't get the custom fields to display in my page template:
1 image-presentation (background)
3 images (products)
2 videos (courses)
The date format in French: Date début: 2022-01-10 Date fin: 13/01/2022I followed your documentation but I can't do it.
Can I send you the informations to connect to my website confidentialy please ? Images and details of the problem ?
Thank you
March 23, 2022 at 4:23 AM #35223Pierre
ParticipantHi,
I have always the same problem.
I can't to manage the format date in french. Please help me.
https://ibb.co/9Gw94yt
https://ibb.co/BTW7GfCThank you
March 23, 2022 at 8:37 PM #35240Long Nguyen
ModeratorHi,
Please refer to this topic to know how to display other date-time formats on the frontend
https://support.metabox.io/topic/display-custom-date-time-format-on-the-front-end/March 24, 2022 at 4:13 AM #35245Pierre
ParticipantHi,
Thank you to answer me.
I added this code but the date format is in english. I would like to display in french but I can't manage it.
Date début : [rwmb_meta id="date_debut" format="d F Y"]
https://ibb.co/YQXnW5v
https://ibb.co/3cq9dkHI am not a coder
Thank you for your help
March 24, 2022 at 12:35 PM #35251Long Nguyen
ModeratorHi,
Please enable the option
timestamp
when creating the field to save the date value intimestamp
format. Then you can display the value in different formats.
Screenshot https://monosnap.com/file/eAIZ6m5QNJ0N8IFgdaAcoop5IJOArcRead more on the documentation https://docs.metabox.io/fields/datetime/#template-usage
March 24, 2022 at 4:46 PM #35258Pierre
ParticipantHi Long,
I added the code and checked the box "Save value as timestamp" but it's dipslay always in format english. I would like to appear in frenc format "Date début : 10 Janvier 2022" and not "Date début : 10 January 2022 ".
https://ibb.co/42vJffH
https://ibb.co/CHwPshX
https://ibb.co/fkdMBKJThank you
March 25, 2022 at 8:22 PM #35297Long Nguyen
ModeratorHi,
If you want to display the date in the French language, you can use the WordPress function
date_i18n()
https://developer.wordpress.org/reference/functions/date_i18n/Please try to use this PHP code in the post template file
$value = rwmb_meta( 'date_debut' ); echo date_i18n( 'F j, Y', $value );
April 10, 2022 at 9:45 PM #35550Pierre
ParticipantHi Long,
I changed my website with elementor PRO and metabox AIO
1/ date french
I'm sorry but I can't change the format date in French. I follow your instructions but it's don't display. I enable the option timestampI added this code snippet
**********************************************
add_action( 'wp_head', function () { ?>
<script>/* write your JavaScript code here */
$value = rwmb_meta( 'debut_date' );
echo date_i18n( 'j F Y', $value );</script>
<?php } );
****************************************************2/Video
I added a field "OEmbed" and put the url youtube video but my video it's not display in website.3/ Fields group custom fields
I can't add the custom field into my field group ? Why ?Can you help me, please
If you need access to my website ask me.
https://eric.digitalpropulse.com/module/test-module/
https://ibb.co/9b4L9rm
https://ibb.co/jZXTgmf
https://ibb.co/smLm0rp
https://ibb.co/PGQ0B22Thankyou
April 12, 2022 at 10:53 PM #35595Long Nguyen
ModeratorHi,
1. Please check this screen record to see how it works on my site https://monosnap.com/file/uLHnzBcBw4pW54cFizPAKpZ551Uf1d
I think you are missing the closing and opening PHP tags in the snippet code and pass the current post ID to the help function if you want to get the field value in the header.add_action( 'wp_head', function () { ?> <script> <?php /* write your JavaScript code here */ $value = rwmb_meta( 'debut_date', '', get_queried_object_id() ); echo date_i18n( 'j F Y', $value ); ?> </script> <?php } );
2. I will check this issue and get back to you later.
3. Do you mean to add the custom fields to the field group builder?
-
AuthorPosts
- You must be logged in to reply to this topic.