how to remember specific action/event for current user?

According to the documentation there are 3 Polylang functions that can help you here : The first to “remember” the user language. pll_current_language // Returns the current language pll_current_language( $value ); // ‘$value’ => (optional) either ‘name’ or ‘locale’ or ‘slug’, defaults to ‘slug’ returns either the full name, or the WordPress locale (just as … Read more

Display country flags with clickable links

The redirecting “drop-down” (select element) part of your question can be answered by looking at this fiddle that someone made for a different question: https://jsfiddle.net/jalbertbowdenii/2f9wvyqm/ As far as getting the flags to appear in the option elements of the select element, the only way to get it to work cross-browser (that I know of), would … Read more

Polylang and template files

One option is to create a single category.php file with conditionals. So, you would have something like this: <?php if(is_category(‘one’) || is_category(‘un’) { // your code here } elseif(is_category(‘two’) || is_category(‘deux’) { // your code here } ?> This way you can still output different code per category, but you won’t have to copy category-one.php … Read more

Filter language in Polylang for custom taxonomy

Nevermind, I finally found. This is not documented, but going through Polylang code I found a way. First retrieve the languages with their taxonomy id with $lang = get_terms(‘term_language’, [‘hide_empty’ => false]) which gives an object that can be called as $lang->name and $lang->term_id. Then, the wp_query should look like this: $args = array( ‘post_type’ … Read more