首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在OJS header.tpl中手动插入规范url

在OJS header.tpl中手动插入规范url
EN

Stack Overflow用户
提问于 2016-08-05 07:44:55
回答 1查看 406关注 0票数 1

我想为我的OJS网站插入一个规范的链接。我设法找到了header.tpl,它看起来是这样的:

代码语言:javascript
复制
{**
 * 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,所以我做了以下操作:

代码语言:javascript
复制
{**
 * 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网站。

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2016-08-06 00:57:21

请注意,这是PKP支持论坛上发布的问题的副本,论坛中有一些进一步的讨论:

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38779059

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档