プラグイン【Browser Shots】バージョン1.3.1からは、”別ウィンドウで開く”や画像サイズをタグで指定できます。
厳選プラグイン18選のBrowser Shotsの解説に、画像をクリックしたときに別ウィンドウ(タブ)で表示させるためのfunctions.phpの修正方法が紹介されていたので、やってみたのですが、どうにも開いてくれませんでした。
それで、プラグインのコードを調べてみたら、functions.phpをいじらなくても、別ウィンドウで表示できることがわかりました。
1 |
[browser-shot url="http://wpblog.sara2jp.com/" target="-blank"] |
このように target=”-blank”を書き加えればOKです。
あらためて、Browser Shots のマニュアルを確認してみると、画像サイズなどもタグ(パラメータ)で指定できるようです。
Available Parameters
url (required) – the url of the link to shorten
width – the width of the image
height – the height of the image
alt – the image alt text
link – where the image links. Left blank it will point to the website where the screenshot is being taken
target – browser target. Set to _blank to open in a new window
どうやら、バージョン1.3.1から、タグが使えるようになったみたいです。
1.3.1
Fix a couple of small bugs with the visual editor and add support for all shortcode parameters
サイズを300×200にしてみます。(デフォルトは600×450です)
1 |
[browser-shot url="http://wpblog.sara2jp.com/" width="300" height="200" target="-blank"]さらさらぶろぐ[/browser-shot] |
上記のコードで、下のようになります。
あれれ?
Browser Shots的には私のサイトは存在してないみたい…(2015/4/14)
なので、もうひとつ例を置いときます。
1 |
[browser-shot url="http://wp-gush.com/" width="300" height="200" target="-blank"]WordPress無料テーマGush2[/browser-shot] |
上記のコードで、下のようになります。
よく使うサイズをAddQuicktagに登録しておけば、便利に使えそうです。
追記:functions.phpの修正がダメだった原因は特定できていません。phpはよくわからないので(^_^;)
この記事へのコメントはこちら