This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Not WPML issue
This topic contains 10 replies, has 3 voices.
Last updated by Waqar Ali 1 year, 7 months ago.
Assisted by: Waqar Ali.
Author | Posts |
---|---|
September 15, 2023 at 2:37 am #14400119 | |
garyC-17 |
I am using the WPML plugin on my WordPress site and I have encountered an issue with excerpts in different languages. My site default language is Traditional Chinese, and I have created some posts and translated them to Simplified Chinese and English using WPML. For the English version, some of the posts will use Traditional Chinese content, I completed the translation in WPML to accept those Traditional Chinese wording. The excerpts work fine in Traditional and Simplified Chinese with the ‘Read More’ link, but the English version will show all the post detail in excerpts and no ‘Read More’ link. I want each language version to show only a short summary of the event with a ‘Read More’ link that leads to the full event page. Could you please help me resolve this issue and advise me on how to display excerpts in different languages without showing all the post detail and losing the ‘Read More’ link? I have tried some possible solutions that I found on the web, such as enabling excerpts in the WPML settings, switching to a default WordPress theme and deactivating other plugins, and using a custom function to modify the excerpt length and read more link based on language. However, none of these solutions worked for me and the issue still persists. Thanks. |
September 17, 2023 at 6:39 am #14407489 | |
Christopher Amirian WPML Supporter since 07/2020
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Before this ticket is assigned to one of my colleagues I'll try to add the initial response. As the issue is happening only ion cases where you used Chinese wording for the English language, I suggest that you consider using the duplicate option in WPML for such posts to see if it works for you or not: Also, I understand you have mentioned you checked the possible conflict, but I would suggest that you check if using the parent Astra theme in combination with the method above works for you. Thank you. |
September 18, 2023 at 9:48 am #14410755 | |
garyC-17 |
Hi Christopher, I have tried using the duplicate option in WPML, but it did not work as expected. I also tested it with the Twenty Twenty-One theme, but the problem persisted. Thx. |
September 18, 2023 at 1:07 pm #14412225 | |
Waqar Ali |
Hi, Thank you for sharing this update. To troubleshoot this, I'll need to see how the WPML and the languages are configured in the admin area. Can you please share the temporary admin login details, along with some links to English versions of the posts that do not show the excerpt and the read more links? Note: Your next reply will be private and it is recommended to make a complete backup copy before sharing the access details. regards, |
September 19, 2023 at 7:29 am #14416721 | |
garyC-17 |
Hi Waqar, Thank you for your willingness to help me troubleshoot the issue. For security reasons, the site is restricted by IP address, so we need to whitelist your IP address before I can share the temporary admin login details with you. Could you please provide me with your IP address? Once we have whitelisted it, I will send you the login details and some links to the posts that show all the post detail and lose the ‘Read More’ link. Thx. |
September 19, 2023 at 2:49 pm #14420633 | |
Waqar Ali |
Thanks for writing back. I don't have a static IP address at the moment, so whitelisting will not work, I'm afraid. Can you please temporarily disable the IP address restriction, during the course of this troubleshooting? Note: I'm setting your next reply as private again. |
September 20, 2023 at 6:07 am #14426323 | |
garyC-17 |
Hi Waqar, Thx for your reply. Unfortunately, we cannot disable the IP restriction setting for security reasons. However, we have some alternative options to assist you with the troubleshooting. One option is to arrange a Teams or Zoom meeting and share the screen with you in the meeting. Our time zone is Hong Kong GMT+8. May I know your time zone and your availability so that we can find a suitable time for both of us? Another option is to let me know which settings you would like to check. I can send you some screenshots of the relevant settings for your further investigation. Please let me know which option you prefer and how we can proceed with the troubleshooting. Thx. |
September 22, 2023 at 6:29 am #14443489 | |
Waqar Ali |
Thank you for waiting as we had a busier than normal forum queue. I'm afraid, a live call/meeting won't be possible, but the best course of action would be your website's clone, that we can work on our test server, without affecting the actual website. Please share your website's duplicator package, as explained in this guide: I'm setting your next reply as private again. |
September 28, 2023 at 8:20 am #14479637 | |
Waqar Ali |
Thank you for sharing the access details. I've performed some testing and the excerpts and WPML are working as expected on this staging website. The way excerpts work in WordPress is that there is a dedicated excerpts field available on the post-edit screen. When no specific excerpt text is provided, it is automatically generated from the content/body of the post. Because of the difference in the character lengths in different languages, the calculated text for the automatically generated excerpt can vary. For this reason, it is a good practice to manually enter some excerpt text, in the excerpt field in the default language and then use the translation screen to translate it into each language. I added some excerpt text for the 'Talks' events post, in the default Chinese (Traditional) language edit screen and then used the translation screen for each language to set a different excerpt. You can see the excerpt for this event, showing correctly in each language's event's archive page ( /events/ ). |
September 28, 2023 at 9:02 am #14479981 | |
garyC-17 |
Hi Waqar, Thank you for your help and guidance. I will try to provide specific excerpt text for each post to resolve my excerpts issue. However, I have one more question: how can I show the ‘Read more’ link after the excerpts if I use this method? Is there a way to add it automatically or do I need to edit the code manually? I appreciate your time and expertise. Please let me know if you have any tips or resources for this. Thx. |
October 3, 2023 at 11:33 am #14503995 | |
Waqar Ali |
Thanks for writing back and glad I could help. That excerpt part of the content is controlled by the template file in the 'The Events Calendar' plugin: /wp-content/plugins/the-events-calendar/src/views/v2/list/event/description.php To customize the content and add a read-more link, you can copy that file into your child theme folder at this folder structure: In that newly copied file, replace: <div class="tribe-events-calendar-list__event-description tribe-common-b2 tribe-common-a11y-hidden"> <?php echo (string) $event->excerpt; ?> </div> With: <div class="tribe-events-calendar-list__event-description tribe-common-b2 tribe-common-a11y-hidden"> <?php echo (string) $event->excerpt; ?> <?php echo '<p class="more-link-container"><a class="more-link wp-block-button__link" href="'. esc_url( get_permalink( get_the_ID() ) ) . '">' . esc_html__( 'Read More', 'tribe_custom_theme_text' ) . '</a></p>'; ?> </div> Note: For details about customization related to 'The Events Calendar' plugin, you can consult their official documentation: |