Custom Fields
Re-Envisioned
Support General Post field with post_type page and wpml

  • Creator
    Topic
  • #5350
    weseo
    Participant

    Hello, i have a normal post field with the post_type “page”.
    I also use wpml in my website.

    When i have saved the post (or option page) with a page value, all works fine and the page is preselected.
    Now when i change the backend language in wmpl, the post select field cant find the preselected page and the value will be changed to an empty string.

    How can i prevent this problem?

    Thank you very much

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #5362
    Anh Tran
    Keymaster

    Hi, you probably need to translate all posts into another language. WPML auto changes the query to include only posts in the current language.

    #5363
    weseo
    Participant

    “WPML auto changes the query to include only posts in the current language.”
    This is the problem, all posts are translate.
    But the option page can only save one page value.

    When i save a german page value and i switch to the english backend (in wpml).
    The select box can’t find the value, because the page id is not available.

    #5370
    Anh Tran
    Keymaster

    I got it. Looks like the ID of the English version is not translated into the ID of the German version. I got help from WPML team to add this feature in the previous version. I will check it now.

    In the worst case, I think a solution for this might be using 2 fields: 1 for English and 1 for German, and in the frontend you can use a condition to get the correct field.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.