問題の概要
WPMLでShoutテーマを使用すると、翻訳されたアイテムからテーマのフィールドとレイアウト設定が失われ、トップバーのテキストとフッターページがデフォルト言語のままになり、一部のショートコードのテキストが翻訳されず、vCardウィジェットのテキストを翻訳できなくなります。前後の投稿へのリンクが別の言語の投稿につながることもあります。
回避策
- WPML設定に移動し、カスタム XML 設定タブを開きます。
- 次のコードを追加して保存します。
XML
<wpml-config> <custom-fields> <custom-field action="translate">member_job</custom-field> <custom-field action="copy">_member_job</custom-field> <custom-field action="translate">member_byline</custom-field> <custom-field action="copy">_member_byline</custom-field> <custom-field action="translate">below_headings_text</custom-field> <custom-field action="copy">_below_headings_text</custom-field> <custom-field action="translate">testimonial_subheading</custom-field> <custom-field action="copy">_testimonial_subheading</custom-field> <custom-field action="translate">pirenko_rotating_text</custom-field> <custom-field action="copy">_pirenko_rotating_text</custom-field> <custom-field action="copy">featured_header</custom-field> <custom-field action="copy">_featured_header</custom-field> <custom-field action="copy">show_sidebar</custom-field> <custom-field action="copy">_show_sidebar</custom-field> <custom-field action="copy">sidebar_pos</custom-field> <custom-field action="copy">_sidebar_pos</custom-field> </custom-fields> <admin-texts> <key name="prk_shout_options"> <key name="bar_left_text_1"/> <key name="theme_divider"/> <key name="woo_subheading"/> <key name="bottom_page_id"/> </key> </admin-texts> <shortcodes> <shortcode> <tag>pirenko_contact_info</tag> <attributes> <attribute>company_name</attribute> <attribute>street_address</attribute> <attribute>locality</attribute> <attribute>postal_code</attribute> <attribute>tel</attribute> <attribute>fax</attribute> <attribute>hours</attribute> <attribute>email</attribute> </attributes> </shortcode> <shortcode> <tag>prk_sitemap</tag> <attributes> <attribute>txt_pages</attribute> <attribute>txt_blog_cats</attribute> <attribute>txt_posts</attribute> <attribute>txt_port_posts</attribute> </attributes> </shortcode> </shortcodes> </wpml-config>
- WPML文字列翻訳に移動します。トップバーのテキストを翻訳し、
bottom_page_idを翻訳したフッターページのIDに翻訳します。 - ページとアイテムを再度翻訳し、翻訳にフィールドが反映されるようにします。
- vCardウィジェットについては、言語ごとに1つのウィジェットを追加し、ウィジェット設定でその言語を設定します。
- 前後の投稿リンクについては、テーマ開発者が修正するまで、テーマオプションで投稿ナビゲーションをオフにすることができます。