0
if (!function_exists('dropdown_categories')) :
function dropdown_categories($show_option_none, $name, $selected = '') {
    if (of_get_option('blog_cat_id')) {
        return apply_filters('dropdown_categories', wp_dropdown_categories(array('hierarchical' => true, 'show_option_none' => $show_option_none, 'exclude_tree' => of_get_option('blog_cat_id') . ',1', 'hide_empty' => 0, 'name' => $name, 'orderby' => 'name', 'selected' => $selected, 'echo' => 0, 'class' => 'board_cat')));
    } else {
        return apply_filters('dropdown_categories', wp_dropdown_categories(array('hierarchical' => true, 'show_option_none' => $show_option_none, 'exclude' => '1', 'hide_empty' => 0, 'name' => $name, 'orderby' => 'name', 'selected' => $selected, 'echo' => 0, 'class' => 'board_cat')));
    }
}
endif;

I need to place recent image in dropdown select item in worpdress, try different things but still not figure out how to place image in select option.

  • 1
    You can't put images inside a <select> tag, if that's what you mean. Unless you mean put the name of an uploaded image as an option in the dropdown? – Jacob Peattie Sep 11 '17 at 6:25
  • please check the screenshot for more clarification :s26.postimg.org/9ulq1pqq1/list.jpg – Maan Sep 11 '17 at 6:47
  • it is not exactly clear how is the question is specific to wordpress, as jacob said, you can not add images to a select element, you will need either to use a special library or design your own solution for that. – Mark Kaplun Sep 11 '17 at 7:29
  • You can use Select2 or similar SELECT tag replacements, and there is no way to do it another way. – Milan Petrovic Sep 11 '17 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.