Support » Plugin: Query Multiple Taxonomies » [Plugin: Query Multiple Taxonomies] Dropdown Selected Option

  • Resolved jennygold

    (@jennygold)


    How can I populate the first dropdown option (currently blank & marked as “selected”) with the taxonomy name?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author scribu

    (@scribu)

    That would mean that you don’t want the taxonomy name to be displayed before the <select>, as it is now, right?

    Thread Starter jennygold

    (@jennygold)

    That’s right. Output the taxonomy as the first option and not have it appear outside of the dropdown.

    Plugin Author scribu

    (@scribu)

    Open widget.php and replace this:

    get_taxonomy( $taxonomy )->label . ': ' . scbForms::input( array(

    with this:

    scbForms::input( array(
      'text' => get_taxonomy( $taxonomy )->label,
    Thread Starter jennygold

    (@jennygold)

    That’s fabulous. Thanks so much!

    Just to build on this question, how do I populate the first dropdown option with the first taxonomy tag?

    As a concrete example, I have a dropdown for “City” taxonomy with 2 cities in it, Bangkok and Chiang Mai. I’d like Bangkok to appear as the default selected option.

    It looks you’ve changed the plugin since you answered to jennygold. I don’t find the same exact line in the current version of the. Would you please help me out how to achieve the same efffect? Thanks.

    I got the solution.

    Go to widget.php, search for

    .html( 'select', array( 'name' => qmt_get_query_var( $taxonomy ) ),
    					'<option></option>'

    (line 179 and 180 to me)

    And change <option></option>’ to <option>My first option here</option>’

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Query Multiple Taxonomies] Dropdown Selected Option’ is closed to new replies.