Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Kocoyoko

    (@kocoyoko)

    Anyone?

    Thread Starter Kocoyoko

    (@kocoyoko)

    Bump

    Which dropdown do you mean?

    Thread Starter Kocoyoko

    (@kocoyoko)

    The name in the form is “select”, here is what I mean:
    http://coacmalaga.es/wp-content/uploads/2011/07/dropdown.jpg

    Ah, i understand. you are doing a backend interface for your plugin?

    http://wpengineer.com/wp-content/uploads/screenshot-2.png
    Here you find a list of all needed elemets including their style classes. For your exact question: You can give your select your own class and define the width by CSS.

    For Example: <select class="my-select-class">

    Then you have to define your own stylesheet CSS file for this.
    Here is the way you can attach the stylesheet to the admin area:

    function admin_register_my_styles() {
        $siteurl = get_option('siteurl');
        $url = $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/yourstyle.css';
        wp_register_style( 'your-plugin-slug', $url );
        wp_enqueue_style( 'your plugin-slug' );
    }
    add_action('admin_print_styles-[YOUR OPTIONS PAGE SLUG]', 'admin_register_my_styles');

    I hope that helped?

    Thread Starter Kocoyoko

    (@kocoyoko)

    Oooops, sorry, I should have said I referred to the plugin Contact Form 7…

    Thank you anyway for your help, I will post again correctly.

    No Problem 🙂

    The form fields from contact form 7 work the same way. you can give them classes like you want. For Example: [select choosesome class:my-class]

    Then you can define the width via CSS in your themes style.css file.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Change dropdown width’ is closed to new replies.