OJS Web サイトの正規リンクを挿入したいと考えています。header.tpl を見つけることができました。次のようになります。
{**
* 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}
サイトの正規 URL を指定するコード ブロックを追加したいので、次のようにしました。
{**
* 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}
<?php
if ( is_front_page() )
echo '<link rel="canonical" href="' . home_url( '/' ) . '" />';
?>
上記は機能しますか?または私のサイトが壊れる原因となります。私がやりたいことを達成するためのより良い方法はありますか? 私はプラグインを疑っていますが、仕事を成し遂げるためのプラグインを特定できませんでした. 私のウェブサイトは OJS ウェブサイトです。
すべての助けをありがとう。