我刚刚在 WP 中找到了一个我喜欢的小部件。但我不想让访问者离开我的博客。
我编辑了插件的 php 文件,但对 PHP 知之甚少,我试图弄清楚当他们访问我的 G+ 页面时如何在新窗口中打开以下链接。
我确定它来自 php 文件中的这些代码片段之一:
/**
* Set the widget defaults
*/
private $widget_title = "Add WHI To Your Google Plus Circles";
private $googleplus_username = "https://plus.google.com/101536806553649165592";
private $googleplus_width = "250";
private $googleplus_header = "true";
或者
/* Our variables from the widget settings. */
$this->widget_title = apply_filters('widget_title', $instance['title']);
$this->googleplus_username = $instance['page_url'];
$this->googleplus_width = $instance['width'];
$this->googleplus_header = ($instance['show_header'] == "1" ? "true" : "false");
或者
/* Like Box */
?>
<div class="g-plus" data-width="<?php echo $this->googleplus_width; ?>"
data-href="<?php echo $this->googleplus_username ?>"
data-rel="publisher">
</div>
这是当前的结果:
我只是认为它与 googleplus_username 有关,这些是文件中的 3 个实例。有人知道我如何配置代码以在新窗口中打开吗?感谢任何人都可以提供的任何指导!