esqualli
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] Display default language postSo… anyone could help me? Anyone needs to use the default language instead of the secondary ones?
Thanks!
Forum: Plugins
In reply to: [Polylang] Display default language postI don’t know why but now does not show the blank page, but still doesn’t show the default post…
The code i put in the functions.php with the Functionality plugin is this:
add_filter( 'pre_get_posts', 'get_default_language_posts' ); function get_default_language_posts( $query ) { if ( $query->is_main_query() && function_exists('pll_default_language') && !is_admin()){ $terms = get_terms('post_translations'); //polylang stores translated post IDs in a serialized array in the description field of this custom taxonomy $defLang = pll_default_language(); //default lanuage of the blog $curLang = pll_current_language(); //current selected language requested on the broswer $filterPostIDs = array(); foreach($terms as $translation){ $transPost = unserialize($translation->description); //if the current language is not the default, lets pick up the default language post if($defLang!=$curLang) $filterPostIDs[]=$transPost[$defLang]; } if($defLang!=$curLang){ $query->set('lang' , $defLang.','.$curLang); //select both default and current language post $query->set('post__not_in', $filterPostIDs); // remove the duplicate post in the default language } } return $query; }Thanks for your help!
Forum: Plugins
In reply to: [Polylang] Display default language postThis is what the debug returned
Notice: Use of undefined constant E_USER_DEPRECATED - assumed 'E_USER_DEPRECATED' in /usr/home/suvisa/www/wordpress/wp-content/plugins/codestyling-localization/codestyling-localization.php on line 2491 Notice: Trying to get property of non-object in /usr/home/suvisa/www/wordpress/wp-content/themes/kallyas/header.php on line 147Forum: Plugins
In reply to: [Polylang] Display default language postHi!
Can anyone could help me with the trouble of showing posts only in the default language?
Thanks!
Forum: Plugins
In reply to: [Polylang] Language switcher don't change it's ownThanks a lot Chrystl.
That plugin helps me understanding the way to use .po and .mo files with plugins, themes,etc… in the theme aren’t created the files for the languages we want, i copied the files inside wp-content/languages and edit them before uploading to the theme folder. It’s all ok right now!
Thanks a lot!
Forum: Plugins
In reply to: [Polylang] Language switcher don't change it's ownIn my theme options there are an option to show the WPML language switch, there aren’t any other option about this, only Show or Hide it.
Forum: Plugins
In reply to: [Polylang] Language switcher don't change it's ownYou can enter to http://www.suvisa.es/wordpress. Only in Spanish the switch is show in this language, in the other languages always show “Languages”.
Thanks!