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: Custom Work
This topic contains 7 replies, has 3 voices.
Last updated by Wes Couch 1 year, 9 months ago.
Assisted by: Long Nguyen.
Author | Posts |
---|---|
August 10, 2023 at 9:36 pm #14185143 | |
Wes Couch |
Tell us what you are trying to do? Is there any documentation that you are following? Is there a similar example that we can see? What is the link to your site? In the top of the header area I am passing an array of page IDs ['10', '18', '7994'] to do a get_permalink() test. The absolute URLs are translated depending on whether you're on English or Dutch home page. |
August 11, 2023 at 11:21 am #14188083 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, while you wait for one of my colleague to take over the case, to speed things up, please follow next steps: I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons. You can access the WordPress dashboard using the link below: Kindly follow the steps below: This will help us to report the possible problem faster. Regards, |
August 14, 2023 at 11:45 pm #14200409 | |
Wes Couch |
Hello Drazen, Let me know if you need more information at this time. Thank you! Edit: Sorry, forgot to mention that I added those get_permalink() echo in the header.php of the active Twenty Twenty-One theme. |
August 15, 2023 at 7:00 am #14201373 | |
Long Nguyen WPML Supporter since 02/2022
Languages: English (English ) Timezone: Asia/Ho_Chi_Minh (GMT+07:00) |
Hi Wes, Thank you for contacting WPML support, I'd be happy to help you with this issue. It happens when the option "Adjust IDs for multilingual functionality" is enabled. You can go to WPML > Languages > Make themes work multilingual section > Disable this option and check the permalink again. Look forward to your reply. |
August 15, 2023 at 4:37 pm #14204395 | |
Wes Couch |
Hello, I followed your instructions, and do see that works when disabling the "Make themes work multilingual section" option. However, disabling this option seems to remove all multilingual functionality from the site. Is this intended? Is there a way to have multilingual functionality and the ability to get URLs using absolute ID? Thanks in advance |
August 16, 2023 at 3:32 am #14205847 | |
Long Nguyen WPML Supporter since 02/2022
Languages: English (English ) Timezone: Asia/Ho_Chi_Minh (GMT+07:00) |
Hi, Yes, it is expected. If you enable that option, WPML attempts to adjust the content/ID and display the content of the current language. echo 'About Us(nl): ' . apply_filters( 'wpml_permalink', get_the_permalink( 56 ), 'nl' ); Refer to the documentation https://wpml.org/wpml-hook/wpml_permalink/ Look forward to your reply. |
August 16, 2023 at 10:16 pm #14241463 | |
Wes Couch |
Thanks, I was able to get it working with the filter hook! For anyone coming here in the future, here's how I was able to create that: |
August 16, 2023 at 10:20 pm #14241469 | |
Wes Couch |
Thanks, I was able to get it working with the filter hook! For anyone coming here in the future, here's how I was able to create that: $wpml_post_lang = apply_filters( 'wpml_post_language_details', NULL, $post_id ); |