最近搜索
没有最近搜索

Simon Celen
已加入2021年4月16日
·
最后活动2022年1月27日
关注
0
关注者
0
活动总数
15
投票
0
订阅
13
活动概览
标记
文章
帖子
社区评论
文章评论
活动概览
的最新活动 Simon Celen
Simon Celen 进行了评论,
社区评论 Feedback - Help Center (Guide)
Hi Bruce,
Assuming a stock Copenhagen theme, you can add the following to the top of your scripts.js file:
jQuery(document).ready(function($) {
$('div.article-body').each(function() {
if ($(this).children().length == 1) {
var p = $(this).children('p');
if (p.length == 1 && p.children('a').length == 1) {
location.href = p.children('a').attr('href');
}
}
});
});
It checks that there is only one line in the article containing a single link. If that's the case, the user is redirected to it.
If you replace the old article's content with f.e. "this article has moved", the user is redirected without you having to edit the scripts.js file again.
Hope that helps!
查看评论 · 已于 2020年1月13日 发布 · Simon Celen
0
关注者
1
投票
0
评论
Simon Celen 进行了评论,