我剛剛在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,再次感謝您花時間回覆! –