我刚刚在WP中发现了一个我喜欢的小工具。但我不想让游客离开我的博客。我编辑了插件的php文件,但对PHP有一点了解,我试图弄清楚如何在访问我的G +页面时在新窗口中打开后续链接。在PHP(Wordpress)中,如何更改此代码以使Google+链接target = blank,并在新窗口中打开?
我敢肯定,它来自的代码在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个实例。有人知道如何配置代码在新窗口中打开吗?感谢任何人可以提供的任何指导!
这是谷歌+代码创建一个小部件。我在配置变量中看不到任何选项来强制打开新窗口。 – datasage
从快速搜索看起来像其他人正在遭受此, http://stackoverflow.com/questions/11440498/how-to-open-the-link-in-new-window-of-google-plus-badge 和一个请求已被提出... http://code.google.com/p/google-plus-platform/issues/detail?id=316 对不起,但它看起来像它在控制Google – Opentuned
感谢Datasage,Stefan Cross,花时间阅读我的问题并作出回应。我想这不是一个问题太紧迫,但像我们许多人一样,我试着去完善事情。 G在某些事情上落后了......就像这样,以及无法从WP(和其他站点)以他们的API的方式发布到G + ......尽管有些第三方工具可以实现这一点。感谢链接,Stefan,再次感谢您花时间回复! –