2011-12-25 8 views
0

Wordpressウィジェットページでは、サイドバーでクリック/トグルするとウィジェットの幅が増加することがわかります。自分のウィジェットでどうすればいいですか?私はWP_Widgetクラスを使用しています。Wordpress Widget Development - 開くときに幅が広くなる

ありがとうございます!

答えて

1

ウィジェットを登録すると、幅を制御できるようにするウィジェット制御オプションを設定できます。

次のサンプルコードチェック:

<?php 
class WP_Widget_Text_Link extends WP_Widget { 

    function WP_Widget_Text_Link() { 
     $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML with Title linked')); 
     $control_ops = array('width' => 600, 'height' => 350); 
     $this->WP_Widget('textlink', __('Text with Link'), $widget_ops, $control_ops); 
    } 

    // stripped down remaining code for the widget, which are not needed for the answer. 
} 
関連する問題