Support » Plugin: Polylang » Polylang and Responsive Theme Calendar

  • Resolved vasheck2



    First of all, thanks for the great plugin!

    I have an issue with an Event Calendar in my responsive theme (Churchope).

    More specifically, I have a bilingual site (En/Fr), English being the default one. When I load my Event Calendar the first time the calendar displays correctly in the appropriate language.

    If I go to the next month in the English version, the correct month (December 2013) / weekdays (Mon Tue Wed …) are displayed on the calendar.

    If I switch the language to French calendar loads in the correct language (novembre 2013 – lun mar mer …). Now my issue occurs when I click on the next month button (“décembre >”). The whole calendar switched back to English even though the rest of the page remain to be in French.

    When I change the default WP language the problem is identical but the languages are reversed. (French calendar OK, Eng loads OK but switches back to Fr)

    I believe this is the code that’s not picking up the language settings.

    jQuery('#previous_month').live('click', function(){
    		sendCalendarData(jQuery(this), 'previous');
    		return false;
    jQuery('#next_month').live('click', function(){
    		sendCalendarData(jQuery(this), 'next');
    		return false;
    function sendCalendarData(obj, month_to_show){
    	var form = obj.closest('form');
    	var form_data = {};
    	if(form && form.length)	{
    		var month = parseInt(jQuery('#calendar_month', form).val(), 10);
    		var year = parseInt(jQuery('#calendar_year', form).val(), 10);
    		var new_month = new_year = 0;
    		if(month_to_show == 'previous')	{
    			if(month == 1){
    				new_month = 12;
    				new_year = year - 1;
    				new_month = month - 1;
    				new_year = year;
    			if(month == 12){
    				new_month = 1;
    				new_year = year + 1;
    				new_month = month + 1;
    				new_year = year;
    		form_data.calendar = true;
    		form_data.month = new_month;
    		form_data.year = new_year;
    		form_data.layout = jQuery('#calendar_layout', form).val();
    		form_data.category = jQuery('#calendar_category', form).val();
    		form_data.from = jQuery('#calendar_from', form).val(); = jQuery('#calendar_to', form).val();
    		form_data.action = 'calendar_walker';
    		type: "POST",
    		url: ThemeData.admin_url,
    		data: form_data,
    		dataType: 'json',
    		success:function(response) {
    			if(response && typeof response == 'object' ){

    Any tips how to remedy the issue?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby


    Try adding:

    pll_load_front: 1

    to your ajax request.

    Otherwise you can try events-maker which is compatible with Polylang

    Hi Chouby,

    Thanks very much for your help. Your suggested to add

    pll_load_front: 1 lead me to other related posts… and I eventually found a solution that worked for me. I save the code in as a php file, placed it in the plugin directory and activated it… The issue seems to be resolved for me. 🙂

    Plugin name: GCE Load Polylang on Ajax requests
    function gce_load_polylang_on_ajax() {
    <script type="text/javascript">
    if (typeof jQuery != 'undefined') {
    		data: { pll_load_front: true }
    add_action( 'wp_head', 'gce_load_polylang_on_ajax' );

    compliments of rosshanney

    thanks again for your help! it’s much appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Polylang and Responsive Theme Calendar’ is closed to new replies.