• Resolved rabox66

    (@rabox66)


    Hi,
    my theme has a page.php but for several reasons, I need to use another template for displaying the calendar. The best would be an individually coded template such as page_calendar.php or something similar. Is it possible to:

    1) use a hook to change the used template somehow?
    2) hardcode a different path in the plugin itself (and update it manually after each update)

    Of course 1) would be much better, but if there is no other way, even 2) would be more or less OK. But for both solutions, I would need a brief explanation.

    Thanks in advance
    Raphael

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter rabox66

    (@rabox66)

    [UPDATE]
    OK, I found it myself. I just have to create a template and then I can choose that template in the settings. But unfortunately, this does not resolve my basic problem which is the language.

    I have a website with the main language German and the second language English. For switching between translations, I use the polylang-plugin which is not supported by the event calendar. https://www.ads-software.com/support/topic/events-calendar-polylang/ Therefore I decided to display the calendar only in English.

    Since the lang attribute is german in the source code, I decided to have the calendar displayed on its own template and change the lang attribute in this template to English. I did as described, but nevertheless, the calendar is displayed in German.

    This is the sourccode:

    <!DOCTYPE html>
    <html lang="en">

    The output in the browser is still in German. So what can I do?
    Thanks
    Raphael

    • This reply was modified 3 years, 8 months ago by rabox66.
    Plugin Contributor Andras Guseo

    (@aguseo)

    Hi @rabox66,

    Good job on finding that setting! That is the way to go.

    You still likely see it in German because the custom template you created still pulls in the default header file with get_header();

    You could create a separate header file for the calendar and then pull that in from the template used for the calendar.

    So instead of get_header(); you would have something like get_header( 'header-calendar.php' );

    And have a header-calendar.php with the appropriate lang attribute.

    This page from the codex might be helpful:
    https://developer.www.ads-software.com/reference/functions/get_header/

    Hope this helps.

    Cheers,
    Andras

    Thread Starter rabox66

    (@rabox66)

    Hi andreas,
    yes, that what you suggest is exactly what I did. ?? But nevertheless, the calendar is in german. If I have a look at the source code of that specific page, it is written: <html lang="en"> But the days and months are in german.

    I could write some jQuery to substitute the German words. But that is not what I call good coding. I would really prefer to have the English version displayed instead of creating a strange workaround.

    You can test it yourself: Please go to https://www.schott-acting-studio.de/schott-events/ Plese tell me, if you see any mistakes in the source code. I cant see any.

    Thanks
    Raphael

    @robox66

    Had the same problem a while ago, g0t a response from Polylang.

    Over ftp add the following code in folder mu-plugins Create folder if it does nort exist

    <?php
    
    add_action( 
    	'plugins_loaded',
    	function() {
    		remove_action( 'pll_init', array( PLL_Integrations::instance()->tec, 'init' ) );
    	},
    	1
    );

    Hope it solves the problem

    Plugin Contributor Andras Guseo

    (@aguseo)

    @rabox66 did you manage to check groenhart’s solution?

    Also note that just by changing the lang tag to English like <html lang="en"> will not change the language of your content. That tag is for the bots like Google bot to know what language the page is.

    A.

    Plugin Support masoodak

    (@masoodak)

    Hi there,

    This thread has been pretty quiet for a while, so we’re going to go ahead and close it. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Have a great day.

    Kind regards,
    Masood

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display calendar in another template then page.php’ is closed to new replies.