How to pick the default selected value in wordpress dropdown?


First of I am pretty new to this so sorry if this has been asked before but I could not find the right answer for me.

I have this dropdown on my websiteenter image description here

from compare-tech(.)fr

I am trying to remove “Toutes les catégories” and make “Acheter” the default value.
I have tried adding a function to wordpress but it did not work, I tried : (again I am new to this)

function wp_dropdown_categories( $args = '' ) { $defaults = array( 'selected' => 2, ); 

Here are some more informations about the html code :

enter image description here

Thanks very much to anyone you would be able to help me !

, , , , Antoine 2 years 2020-01-16T08:38:24-05:00 0 Answers 95 views 0

Leave an answer