Manually insert canonical url in OJS header.tpl
<p>I want to insert a canonical link for my OJS website. I managed to find the header.tpl and it looks like this:</p>

<pre><code>{**
 * templates/common/header.tpl
 *
 * Copyright (c) 2013-2015 Simon Fraser University Library
 * Copyright (c) 2003-2015 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Common site header.
 *}
{strip}
{translate|assign:"applicationName" key="common.openJournalSystems"}
{include file="core:common/header.tpl"}
{/strip}
</code></pre>

<p>I wand to add some block of code to specify the canonical url for my site so i did the following:</p>

<pre><code>{**
 * templates/common/header.tpl
 *
 * Copyright (c) 2013-2015 Simon Fraser University Library
 * Copyright (c) 2003-2015 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Common site header.
 *}
{strip}
{translate|assign:"applicationName" key="common.openJournalSystems"}
{include file="core:common/header.tpl"}
{/strip}
&lt;?php
if ( is_front_page() )
    echo '&lt;link rel="canonical" href="' . home_url( '/' ) . '" /&gt;';
?&gt;
</code></pre>

<p>Will the above work? or cause my site to break. Is there a better way to achieve what i want to do? I'm suspecting plugins but could not identify any to get the job done. My website is an OJS website.</p>

<p>Thanks for all the help.</p>