Lingonberry 主题列表页文章在新窗口打开

设计教程 & 文章 2019-01-30 1,241 次浏览 0 条评论

因为 WP 默认是不在新窗口打开链接的,Lingonberry 主题也没有,所以动手折腾一下让在文章列表页的时候点击链接可以在新窗口打开。

因为这个主题有 10 个文章形式,分别是:

  • content.php
  • content-aside.php
  • content-audio.php
  • content-chat.php
  • content-gallery.php
  • content-image.php
  • content-link.php
  • content-quote.php
  • content-status.php
  • content-video.php

文件位置是在主题文件夹内,用记事本或者你习惯的编辑器,打开这 10 个 php 文件,在其代码内查找

<a href="<?php the_permalink(); ?>"

替换成

<a href="<?php the_permalink(); ?>" target="_blank"

保存,上传便可,记得备份原文件。

本文地址:acupof.top

广告
广告

发表评论

您的电子邮箱地址不会被公开。