Reputation: 5741
I just found a widget I like in WP. But I don't wanna take visitors off my blog.
I edited the plugin's php file, but having little knowledge of PHP, I'm trying to figure out how I can make the follow link open in a new window when they visit my G+ page.
I'm sure it comes from one of these snippets of code in the php file:
/**
* 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";
or
/* 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");
or
/* Like Box */
?>
<div class="g-plus" data-width="<?php echo $this->googleplus_width; ?>"
data-href="<?php echo $this->googleplus_username ?>"
data-rel="publisher">
</div>
Here's the current result:
I just figured it had something to do with googleplus_username, and those are the 3 instances of it in the file. Does anybody know how I can configure the code to open up in a new window? Thanks for any guidance anybody can offer!
Upvotes: 0
Views: 110
Reputation: 1113
Does the widget insert html code in your template, or is it an iframe? In the latter case you're screwed and you'll probably have to wait for google to fix it.
If it inserts html, you could always add a javascript/jquery snippet to the page, forcing the urls to do a "target='_blank'".
Something like this:
$("#widget_id a").attr("target","_blank");
Upvotes: 1