Wordpress Polylang Front Page Error
12 Ağustos 2020

The chosen static front page must be translated in all languages

ile kurtitasarim

Merhabalar bugün The chosen static front page must be translated in all languages hatası hakkında bilgi vermeye çalışacağım. WordPress Polylang eklentisi ile birden fazla dil kullandığınız zaman varsayılan sayfa seçiminde aldığınız

Neden Olur?

Bu hatanın başlıca sebebi aslında front olarak belirlediğiniz sayfanın farklı dillerde karşılığı olmamasıdır. Bu sebeple varsayılan sayfa belirlemek istediğiniz zaman size bu hatayı vermesi normaldir.

Nasıl Düzeltirim

Bu işlemin aslında 2 yolu var bunlar;
1. Front sayfanızı düzenle yaparak diğer dilleri oluşturmak
2. Farklı sayfalarınız var ise, bunları database üzerinden set edebilirsiniz.

Benim burada anlatacağım işlem ise basit şekilde mysql üzerinden nasıl yapıyoruz bunu size anlatmaya çalışacağım.

Ben dil olara burada Tr,De,En,Ru dillerini baz alarak anlatacağım.

Gelelim Nasıl Yapılır Kısmına

wp_options tablosuna giriniz ve arama kısmından option_name alanına _transient_pll_languages_list değerini aratınız.

Karşısında bulunan değerler sizin varsayılan sayfanız ve front sayfalarınızdır. Buradaki değerler php serialize edilmiş haldedir. Ben size örnek olarak kendi değerlerimi paylaşarak anlatacağım, fakat siz burada kendi değerlerinizi girerek güncellemeniz gerekmekte veya belirttiğim yerleri düzeltmeniz gereklidir.

a:4:{i:0;a:26:{s:7:"term_id";i:11;s:4:"name";s:7:"Deutsch";s:4:"slug";s:2:"de";s:10:"term_group";i:0;s:16:"term_taxonomy_id";i:11;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"de_DE";s:6:"parent";i:0;s:5:"count";i:4;s:10:"tl_term_id";i:12;s:19:"tl_term_taxonomy_id";i:12;s:8:"tl_count";i:1;s:6:"locale";R:9;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"de-DE";s:8:"facebook";s:5:"de_DE";s:8:"flag_url";s:70:"https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/de.png";s:4:"flag";s:817:"<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGzSURBVHjaYvTxcWb4+53h3z8GZpZff/79+v3n/7/fDAz/GHAAgABi+f37e3FxOZD1Dwz+/v3z9y+E/AMFv3//+Qumfv9et241QACxMDExAVWfOHkJJAEW/gUEP0EQDn78+AHE/gFOQJUAAcQiy8Ag8O+fLFj1n1+/QDp+/gQioK7fP378+vkDqOH39x9A/RJ/gE5lAAhAYhzcAACCQBDkgRXRjP034R0IaDTZTFZn0DItot37S94KLOINerEcI7aKHAHE8v/3r/9//zIA1f36/R+o4tevf1ANYNVA9P07RD9IJQMDQACxADHD3z8Ig4GMHz+AqqHagKp//fwLVA0U//v7LwMDQACx/LZiYFD7/5/53/+///79BqK/EMZ/UPACSYa/v/8DyX9A0oTxx2EGgABi+a/H8F/m339BoCoQ+g8kgRaCQvgPJJiBYmAuw39hxn+uDAABxMLwi+E/0PusRkwMvxhBGoDkH4b/v/+D2EDyz///QB1/QLb8+sP0lQEggFh+vGXYM2/SP6A2Zoaf30Ex/J+PgekHwz9gQDAz/P0FYrAyMfz7wcDAzPDtFwNAgAEAd3SIyRitX1gAAAAASUVORK5CYII=" title="Deutsch" alt="Deutsch" width="16" height="11" />";s:8:"home_url";s:26:"https://www.xxxxxxx.com/";s:10:"search_url";s:26:"https://www.xxxxxxx.com/";s:4:"host";N;s:5:"mo_id";s:3:"744";s:13:"page_on_front";i:10;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:2:"de";}i:1;a:26:{s:7:"term_id";i:14;s:4:"name";s:7:"English";s:4:"slug";s:2:"en";s:10:"term_group";i:1;s:16:"term_taxonomy_id";i:14;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"en_GB";s:6:"parent";i:0;s:5:"count";i:1;s:10:"tl_term_id";i:15;s:19:"tl_term_taxonomy_id";i:15;s:8:"tl_count";i:1;s:6:"locale";R:35;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"en-GB";s:8:"facebook";s:5:"en_GB";s:8:"flag_url";s:70:"https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/gb.png";s:4:"flag";s:889:"<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAflJREFUeNpinDRzn5qN3uFDt16+YWBg+Pv339+KGN0rbVP+//2rW5tf0Hfy/2+mr99+yKpyOl3Ydt8njEWIn8f9zj639NC7j78eP//8739GVUUhNUNuhl8//ysKeZrJ/v7z10Zb2PTQTIY1XZO2Xmfad+f7XgkXxuUrVB6cjPVXef78JyMjA8PFuwyX7gAZj97+T2e9o3d4BWNp84K1NzubTjAB3fH0+fv6N3qP/ir9bW6ozNQCijB8/8zw/TuQ7r4/ndvN5mZgkpPXiis3Pv34+ZPh5t23//79Rwehof/9/NDEgMrOXHvJcrllgpoRN8PFOwy/fzP8+gUlgZI/f/5xcPj/69e/37//AUX+/mXRkN555gsOG2xt/5hZQMwF4r9///75++f3nz8nr75gSms82jfvQnT6zqvXPjC8e/srJQHo9P9fvwNtAHmG4f8zZ6dDc3bIyM2LTNlsbtfM9OPHH3FhtqUz3eXX9H+cOy9ZMB2o6t/Pn0DHMPz/b+2wXGTvPlPGFxdcD+mZyjP8+8MUE6sa7a/xo6Pykn1s4zdzIZ6///8zMGpKM2pKAB0jqy4UE7/msKat6Jw5mafrsxNtWZ6/fjvNLW29qv25pQd///n+5+/fxDDVbcc//P/zx/36m5Ub9zL8+7t66yEROcHK7q5bldMBAgwADcRBCuVLfoEAAAAASUVORK5CYII=" title="English" alt="English" width="16" height="11" />";s:8:"home_url";s:41:"https://www.xxxxxxx.com/en/xxxxxxx-2/";s:10:"search_url";s:29:"https://www.xxxxxxx.com/en/";s:4:"host";N;s:5:"mo_id";s:3:"747";s:13:"page_on_front";i:346;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:2:"gb";}i:2;a:26:{s:7:"term_id";i:18;s:4:"name";s:8:"Türkçe";s:4:"slug";s:2:"tr";s:10:"term_group";i:2;s:16:"term_taxonomy_id";i:18;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"tr_TR";s:6:"parent";i:0;s:5:"count";i:1;s:10:"tl_term_id";i:19;s:19:"tl_term_taxonomy_id";i:19;s:8:"tl_count";i:1;s:6:"locale";R:61;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"tr-TR";s:8:"facebook";s:5:"tr_TR";s:8:"flag_url";s:70:"https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/tr.png";s:4:"flag";s:747:"<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF+SURBVHjaYvzPgAD/UNlYEUAAmuTYBgAYhIEgJJmboZgtHbaJKNK8TvozM8LIllwagEY4sIFV1UD/3swngMAaGBn/P3kCVApS7ebG8O/f/x07/n/6BFL36/f/37/+//oFZDPKygJtAAggkIb/YINBqqOjGUxNQeqUlf93dIDV/QLpAWtg+P0bqAEggJhA7gaqBtqoqMjg5PR/+vT/SUn/N2z4//Xr/+XL//Pwgu2BWgJUCxBATCAn/fgJEnVx/Q+05NgxkNzp0/9XrPgvJPR/zZr/ZmZQDX/+AE0HCCCQhv9//4D89OQxMMT+a2uDnKGm9v/SJZCrHj36v28fRAPESQABxALEjGBLGRYv/s/H97+oCOQYIIiM/P/ly/9Fi6CO+QMy9A8DA0AAgTQwg4MMaMD/rq7/vr7/WVlBrv/8GeROiAf+ADWAQgXoHIAAAmlg+v+fQVISbMxfhpMngToZhYUZ+PkZwAaDEDgMgQioGCCAGL+iRiSeOIYAgAADAO/XO1xGA79vAAAAAElFTkSuQmCC" title="Türkçe" alt="Türkçe" width="16" height="11" />";s:8:"home_url";s:41:"https://www.xxxxxxx.com/tr/xxxxxxx-2/";s:10:"search_url";s:29:"https://www.xxxxxxx.com/tr/";s:4:"host";N;s:5:"mo_id";s:3:"748";s:13:"page_on_front";i:663;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:2:"tr";}i:3;a:26:{s:7:"term_id";i:22;s:4:"name";s:14:"Русский";s:4:"slug";s:2:"ru";s:10:"term_group";i:4;s:16:"term_taxonomy_id";i:22;s:8:"taxonomy";s:8:"language";s:11:"description";s:5:"ru_RU";s:6:"parent";i:0;s:5:"count";i:1;s:10:"tl_term_id";i:23;s:19:"tl_term_taxonomy_id";i:23;s:8:"tl_count";i:1;s:6:"locale";R:87;s:6:"is_rtl";i:0;s:3:"w3c";s:5:"ru-RU";s:8:"facebook";s:5:"ru_RU";s:8:"flag_url";s:70:"https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/ru.png";s:4:"flag";s:663:"<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE2SURBVHjaYvz69T8DAvz79w9CQVj/0MCffwwAAcQClObiAin6/x+okxHMgPCAbOb//5n+I4EXL74ABBALxGSwagTjPzbAyMgItAQggBg9Pf9nZPx//x7kjL9////9C2QAyf9//qCQQCQkxFhY+BEggFi2b/+nq8v46BEDSPQ3w+8//3//BqFfv9BJeXmQEwACCOSkP38YgHy4Bog0RN0vIOMXVOTPH6Cv/gEEEEgDxFKgHEgDXCmGDUAE1AAQQCybGZg1f/d8//XsH0jTn3+///z79RtE/v4NZfz68xfI/vOX+4/0ZoZFAAHE4gYMvD+3/v2+h91wCANo9Z+/jH9VxBkYAAKIBRg9TL//MEhKAuWAogxgZzGC2CCfgUggAoYdGAEVAwQQ41egu5AQAyoXTQoIAAIMAD+JZR7YOGEWAAAAAElFTkSuQmCC" title="Русский" alt="Русский" width="16" height="11" />";s:8:"home_url";s:29:"https://www.xxxxxxx.com/ru/";s:10:"search_url";s:29:"https://www.xxxxxxx.com/ru/";s:4:"host";N;s:5:"mo_id";s:3:"749";s:13:"page_on_front";i:183;s:14:"page_for_posts";b:0;s:6:"filter";s:3:"raw";s:9:"flag_code";s:2:"ru";}}

Yukarıdaki serialize edilmiş sayfamın çıktısı ise;

Array
(
    [0] => Array
        (
            [term_id] => 11
            [name] => Deutsch
            [slug] => de
            [term_group] => 0
            [term_taxonomy_id] => 11
            [taxonomy] => language
            [description] => de_DE
            [parent] => 0
            [count] => 4
            [tl_term_id] => 12
            [tl_term_taxonomy_id] => 12
            [tl_count] => 1
            [locale] => de_DE
            [is_rtl] => 0
            [w3c] => de-DE
            [facebook] => de_DE
            [flag_url] => https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/de.png
            [flag] => <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGzSURBVHjaYvTxcWb4+53h3z8GZpZff/79+v3n/7/fDAz/GHAAgABi+f37e3FxOZD1Dwz+/v3z9y+E/AMFv3//+Qumfv9et241QACxMDExAVWfOHkJJAEW/gUEP0EQDn78+AHE/gFOQJUAAcQiy8Ag8O+fLFj1n1+/QDp+/gQioK7fP378+vkDqOH39x9A/RJ/gE5lAAhAYhzcAACCQBDkgRXRjP034R0IaDTZTFZn0DItot37S94KLOINerEcI7aKHAHE8v/3r/9//zIA1f36/R+o4tevf1ANYNVA9P07RD9IJQMDQACxADHD3z8Ig4GMHz+AqqHagKp//fwLVA0U//v7LwMDQACx/LZiYFD7/5/53/+///79BqK/EMZ/UPACSYa/v/8DyX9A0oTxx2EGgABi+a/H8F/m339BoCoQ+g8kgRaCQvgPJJiBYmAuw39hxn+uDAABxMLwi+E/0PusRkwMvxhBGoDkH4b/v/+D2EDyz///QB1/QLb8+sP0lQEggFh+vGXYM2/SP6A2Zoaf30Ex/J+PgekHwz9gQDAz/P0FYrAyMfz7wcDAzPDtFwNAgAEAd3SIyRitX1gAAAAASUVORK5CYII=" title="Deutsch" alt="Deutsch" width="16" height="11" />
            [home_url] => https://www.xxxxxxx.com/
            [search_url] => https://www.xxxxxxx.com/
            [host] => 
            [mo_id] => 744
            [page_on_front] => 10
            [page_for_posts] => 
            [filter] => raw
            [flag_code] => de
        )

    [1] => Array
        (
            [term_id] => 14
            [name] => English
            [slug] => en
            [term_group] => 1
            [term_taxonomy_id] => 14
            [taxonomy] => language
            [description] => en_GB
            [parent] => 0
            [count] => 1
            [tl_term_id] => 15
            [tl_term_taxonomy_id] => 15
            [tl_count] => 1
            [locale] => en_GB
            [is_rtl] => 0
            [w3c] => en-GB
            [facebook] => en_GB
            [flag_url] => https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/gb.png
            [flag] => <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAflJREFUeNpinDRzn5qN3uFDt16+YWBg+Pv339+KGN0rbVP+//2rW5tf0Hfy/2+mr99+yKpyOl3Ydt8njEWIn8f9zj639NC7j78eP//8739GVUUhNUNuhl8//ysKeZrJ/v7z10Zb2PTQTIY1XZO2Xmfad+f7XgkXxuUrVB6cjPVXef78JyMjA8PFuwyX7gAZj97+T2e9o3d4BWNp84K1NzubTjAB3fH0+fv6N3qP/ir9bW6ozNQCijB8/8zw/TuQ7r4/ndvN5mZgkpPXiis3Pv34+ZPh5t23//79Rwehof/9/NDEgMrOXHvJcrllgpoRN8PFOwy/fzP8+gUlgZI/f/5xcPj/69e/37//AUX+/mXRkN555gsOG2xt/5hZQMwF4r9///75++f3nz8nr75gSms82jfvQnT6zqvXPjC8e/srJQHo9P9fvwNtAHmG4f8zZ6dDc3bIyM2LTNlsbtfM9OPHH3FhtqUz3eXX9H+cOy9ZMB2o6t/Pn0DHMPz/b+2wXGTvPlPGFxdcD+mZyjP8+8MUE6sa7a/xo6Pykn1s4zdzIZ6///8zMGpKM2pKAB0jqy4UE7/msKat6Jw5mafrsxNtWZ6/fjvNLW29qv25pQd///n+5+/fxDDVbcc//P/zx/36m5Ub9zL8+7t66yEROcHK7q5bldMBAgwADcRBCuVLfoEAAAAASUVORK5CYII=" title="English" alt="English" width="16" height="11" />
            [home_url] => https://www.xxxxxxx.com/en/xxxxxxx-2/
            [search_url] => https://www.xxxxxxx.com/en/
            [host] => 
            [mo_id] => 747
            [page_on_front] => 346
            [page_for_posts] => 
            [filter] => raw
            [flag_code] => gb
        )

    [2] => Array
        (
            [term_id] => 18
            [name] => Türkçe
            [slug] => tr
            [term_group] => 2
            [term_taxonomy_id] => 18
            [taxonomy] => language
            [description] => tr_TR
            [parent] => 0
            [count] => 1
            [tl_term_id] => 19
            [tl_term_taxonomy_id] => 19
            [tl_count] => 1
            [locale] => tr_TR
            [is_rtl] => 0
            [w3c] => tr-TR
            [facebook] => tr_TR
            [flag_url] => https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/tr.png
            [flag] => <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF+SURBVHjaYvzPgAD/UNlYEUAAmuTYBgAYhIEgJJmboZgtHbaJKNK8TvozM8LIllwagEY4sIFV1UD/3swngMAaGBn/P3kCVApS7ebG8O/f/x07/n/6BFL36/f/37/+//oFZDPKygJtAAggkIb/YINBqqOjGUxNQeqUlf93dIDV/QLpAWtg+P0bqAEggJhA7gaqBtqoqMjg5PR/+vT/SUn/N2z4//Xr/+XL//Pwgu2BWgJUCxBATCAn/fgJEnVx/Q+05NgxkNzp0/9XrPgvJPR/zZr/ZmZQDX/+AE0HCCCQhv9//4D89OQxMMT+a2uDnKGm9v/SJZCrHj36v28fRAPESQABxALEjGBLGRYv/s/H97+oCOQYIIiM/P/ly/9Fi6CO+QMy9A8DA0AAgTQwg4MMaMD/rq7/vr7/WVlBrv/8GeROiAf+ADWAQgXoHIAAAmlg+v+fQVISbMxfhpMngToZhYUZ+PkZwAaDEDgMgQioGCCAGL+iRiSeOIYAgAADAO/XO1xGA79vAAAAAElFTkSuQmCC" title="Türkçe" alt="Türkçe" width="16" height="11" />
            [home_url] => https://www.xxxxxxx.com/tr/xxxxxxx-2/
            [search_url] => https://www.xxxxxxx.com/tr/
            [host] => 
            [mo_id] => 748
            [page_on_front] => 663
            [page_for_posts] => 
            [filter] => raw
            [flag_code] => tr
        )

    [3] => Array
        (
            [term_id] => 22
            [name] => Русский
            [slug] => ru
            [term_group] => 4
            [term_taxonomy_id] => 22
            [taxonomy] => language
            [description] => ru_RU
            [parent] => 0
            [count] => 1
            [tl_term_id] => 23
            [tl_term_taxonomy_id] => 23
            [tl_count] => 1
            [locale] => ru_RU
            [is_rtl] => 0
            [w3c] => ru-RU
            [facebook] => ru_RU
            [flag_url] => https://www.xxxxxxx.com/wp-content/plugins/polylang-pro/flags/ru.png
            [flag] => <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE2SURBVHjaYvz69T8DAvz79w9CQVj/0MCffwwAAcQClObiAin6/x+okxHMgPCAbOb//5n+I4EXL74ABBALxGSwagTjPzbAyMgItAQggBg9Pf9nZPx//x7kjL9////9C2QAyf9//qCQQCQkxFhY+BEggFi2b/+nq8v46BEDSPQ3w+8//3//BqFfv9BJeXmQEwACCOSkP38YgHy4Bog0RN0vIOMXVOTPH6Cv/gEEEEgDxFKgHEgDXCmGDUAE1AAQQCybGZg1f/d8//XsH0jTn3+///z79RtE/v4NZfz68xfI/vOX+4/0ZoZFAAHE4gYMvD+3/v2+h91wCANo9Z+/jH9VxBkYAAKIBRg9TL//MEhKAuWAogxgZzGC2CCfgUggAoYdGAEVAwQQ41egu5AQAyoXTQoIAAIMAD+JZR7YOGEWAAAAAElFTkSuQmCC" title="Русский" alt="Русский" width="16" height="11" />
            [home_url] => https://www.xxxxxxx.com/ru/
            [search_url] => https://www.xxxxxxx.com/ru/
            [host] => 
            [mo_id] => 749
            [page_on_front] => 183
            [page_for_posts] => 
            [filter] => raw
            [flag_code] => ru
        )

)

Yukarıdaki değerlerde sizin için önemli olanlar şu şekilde olacaktır;

i:183;s:14 belirlenen bir front sayfa yok ise sizde i değeri yerine b:0 olarak gelecektir. Bu kısmı i:page_id olarak güncellemeniz gereklidir.

page_on_front ” Bu sizin front olarak belirleyeceğiniz sayfanın id numarasıdır, bunu sayfa düzenle kısmından yaparak adres satırından bulabilirsiniz.

term_id wp_terms tablosunda bulunan polylang eklentinizin dil id’sinin term karşılığıdır. Bu ayar genelde siz wp_options tablosundan serialize değerlerinde otomatik olarak gelmektedir. bu kısımda sizin sadece aslında page_on_front kısmını güncellemeniz yetecektir

Diğer güncellemeniz gereken alan ise;
wp_term_taxonomy arama yaparak taxonomy değerine post_translations yazarak arama yapınız.

description değerine ise yapamanız gerekenler ise.

a:4:{s:2:"de";i:10;s:2:"en";i:346;s:2:"tr";i:663;s:2:"ru";i:183;}

buradaki serialize değerlerimizi unserialize ederek çıktıyı görelim.

Array
(
    [de] => 10
    [en] => 346
    [tr] => 663
    [ru] => 183
)

her dilin karşılığında değerler sayfa işleri yani bizim serialize kısmındaki i:page_id değerlerimizdir.

The chosen static front page must be translated in all languages Çözümü

Bu yazımızda php dilinde geliştirilen wordpress CMS sisteminde kullanılan multi language dil eklentisi olan polylang hatası hakkında bilgi verebiliriz.