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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 14:00 | 9:00 – 14:00 | 9:00 – 14:00 | 9:00 – 14:00 | 9:00 – 14:00 | - |
- | 15:00 – 18:00 | 15:00 – 18:00 | 15:00 – 18:00 | 15:00 – 18:00 | 15:00 – 18:00 | - |
Supporter timezone: Asia/Dhaka (GMT+06:00)
This topic contains 7 replies, has 2 voices.
Last updated by Prosenjit Barman 1 year, 1 month ago.
Assisted by: Prosenjit Barman.
Author | Posts |
---|---|
March 7, 2024 at 2:43 am #15381996 | |
佳樹 岡田 |
Hello. 1. language switcher URL does not work correctly do_action('wpml_add_language_selector'); Example: hidden link This event occurs only on article pages of custom post types. 2. Translated pages do not appear in the archive Only translated pages are not displayed in the taxonomy archive of custom post types or in the article list view using WP_Query. If you set "Post Types Translation" to "only show translated items", the articles are not displayed, and if you set "use translation id~", only untranslated pages are displayed. It would be helpful to know the cause. |
March 7, 2024 at 12:01 pm #15384037 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, I understand the issue you're having. In an attempt to directly observe the issue, I tried accessing your website. However, due to browser login protection, I was unable to proceed with the examination. Regarding the Fatal error you mentioned when accessing a specific link, could you please activate the WordPress Debug log to see if any errors are being logged as a result? For guidance on enabling the debug log, you might find this tutorial helpful: https://wpml.org/documentation/support/debugging-wpml/. If you encounter any errors in the log, kindly copy them and provide the details in your next message. This will allow me to conduct a more thorough analysis and advise you on the subsequent steps. Additionally, the issue with Translated articles not appearing in the Archive may stem from how the WP_Query is being implemented. Would you be able to share the relevant code snippet? Although custom code support falls outside our standard support parameters, I am willing to review the code and offer suggestions on how to ensure translated posts are visible in the archive. I look forward to your reply and am eager to offer further assistance. Best regards, |
March 7, 2024 at 1:54 pm #15384694 | |
佳樹 岡田 |
Thanks for the reply. --------------------------------------- $shop_all_args = array( ), $shop_all_query = new WP_Query($shop_all_args); --------------------------------------- If you can find the cause, please let me know. Best regards. |
March 7, 2024 at 9:48 pm #15386925 | |
佳樹 岡田 |
Hi. --------------------------------------- [07-Mar-2024 21:44:59 UTC] PHP Deprecated: Creation of dynamic property Whip_RequirementsChecker::$configuration is deprecated in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/vendor/yoast/whip/src/Whip_RequirementsChecker.php on line 37 |
March 7, 2024 at 9:58 pm #15386935 | |
佳樹 岡田 |
>do_action('wpml_add_language_selector'); >Example: hidden link >This event occurs only on article pages of custom post types. The error text when accessing the "Correct URL" above is as follows. --------------------------------------- [07-Mar-2024 21:49:46 UTC] PHP Warning: Trying to access array offset on value of type null in /var/www/html/wp-content/themes/kitte-theme/single-shop.php on line 40 --------------------------------------- The code in the relevant section was reading the Custom Field data created in ACF. --------------------------------------- $info = get_field('info'); --------------------------------------- I would be happy to know anything you can tell me with the above information. |
March 8, 2024 at 9:07 am #15387846 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hi, Let's tackle the issues one at a time. Based on the error log you've provided, there doesn't seem to be any critical errors or warnings stemming from the WPML plugin or its extensions. The fatal error you're encountering points to an issue within your theme's PHP code. Specifically, the error at line 56 in the `single-shop.php` file arises because the `array_filter()` function expects an array, but instead, it's receiving a null value. This discrepancy could be the result of a failed database query, an unexpected function return value, or another operation that didn't produce the expected array. To resolve this error, it's necessary to trace back and determine why the expected array is turning up as null. This might involve examining earlier segments of your code where this variable is initialized or modified. Please note, that addressing issues related to custom code, themes, or plugins falls outside our standard support scope. Therefore, we suggest consulting with the developer who wrote the code for more direct assistance. They should be able to identify the root cause and help rectify the issue. For the issue with the Translated posts not appearing in the Archive - Thank you for sharing the WP_Query code. From the code, I noticed that you've defined a meta_key named 'yomigana' and in the meta query, you've defined a key named "coming soon". Could you please ensure that the same Meta that you've defined are also set for the translated post? If you want the same Meta information to appear in the translated posts, please go to "WPML > Setting" and search for both keys in "Custom Field Translation" and "Custom Term Meta Translation" section. If they appear in the result, set the translation preference for both keys to "Copy", and update the default page and the translation as well. If the translated posts still not showing in the archive, you can add the following argument right after "'order' => 'ASC'," in the WP_Query code: 'suppress_filters' => true, I hope the information above helps. Please feel free to let me know if you need further assistance. I'll be happy to help. Best regards, |
March 11, 2024 at 9:55 am #15394030 | |
佳樹 岡田 |
I reviewed the Custom Field settings as you suggested and the error is gone. Thanks! As shown below, incorrect link URLs are output only on custom post type article pages. *URLs are supposed to be assigned by language, but they are all assigned "en". ------------------ <link rel="alternate" hreflang="ja" href="hidden link" /> ------------------ <div class="wpml-ls-statics-shortcode_actions wpml-ls wpml-ls-legacy-list-horizontal">
hidden link" class="wpml-ls-link"> <span class="wpml-ls-native" lang="ja">日本語</span> <li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-en wpml-ls-current-language wpml-ls-item-legacy-list-horizontal"> hidden link" class="wpml-ls-link"> <span class="wpml-ls-native">English</span> <li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-ko wpml-ls-item-legacy-list-horizontal"> hidden link" class="wpml-ls-link"> <span class="wpml-ls-native" lang="ko">한국어</span> <li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-zh-hans wpml-ls-item-legacy-list-horizontal"> hidden link" class="wpml-ls-link"> <span class="wpml-ls-native" lang="zh-hans">简体中文</span> <li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-zh-hant wpml-ls-last-item wpml-ls-item-legacy-list-horizontal"> hidden link" class="wpml-ls-link"> <span class="wpml-ls-native" lang="zh-hant">繁體中文</span> </div> ------------------ Best regards, |
March 12, 2024 at 4:12 am #15397675 | |
Prosenjit Barman WPML Supporter since 03/2023
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, Thank you for the update. Glad to hear that the suggestions helped! 🙂 Regarding the problem with links - Could you please check and ensure that the posts you've within the "Shop" post type have been translated into other languages? If not, please translate them and check again. If they have been translated, then please try the following: - Please go to WPML > Support > Troubleshooting Once the troubleshooting is completed, please clear the caches from your site and browser and check the posts in the Shop post type again. Let me know how it goes. I will be happy to help if you need further assistance in this matter. Best regards, |
The topic ‘[Closed] Incorrect link URL in selector and 404 when translating custom post type’ is closed to new replies.