1

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 ウェブサイトです。

すべての助けをありがとう。

4

1 に答える 1

0

これは、PKP サポート フォーラムに投稿された質問の複製であることに注意してください。

http://forum.pkp.sfu.ca/t/manually-insert-canonical-url-in-ojs-header-tpl/17415/4

于 2016-08-05T16:57:21.473 に答える