• Resolved bananenkopf

    (@bananenkopf)


    Hey,

    inside a form I am using

    <?php wp_dropdown_categories( '...

    but this doesn’t fit into my style.

    I tried adding a <div style=””> around the php but this doesn’t work.

    So how to change the style?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • I don’t quite understand what you mean. If you want to add custom styles and you’re already in the code you should be doing so in your themes style.css or some other external stylesheet.

    There’s also Appearance -> Customize -> Custom CSS if you’re an admin trying to override theme styles.

    Looking at the code that generates the select, I don’t see an easy way to add in a style attribute without str_replace() the output. You’re better off looking into styling alternatives mentioned above.

    Thread Starter bananenkopf

    (@bananenkopf)

    Hey McGee,

    exactly its about the created dropdown that does not fit the style.

    Isn’t there a smimple trick to change it?

    Maybe there’s a class on the other fields. It’s difficult to say. Adding custom styles to Appearance -> Customize -> Custom CSS in the WordPress admin panel may be your best bet. If you do not know CSS then maybe it’s time to contact a local developer or go to one of your local WordPress meetups.

    Thread Starter bananenkopf

    (@bananenkopf)

    Thats how I solved it:

    I rendered the output and used firefox Inspector to get out what css group the dropdown is dedicated to.

    <select name="cat" id="cat" class="postform">
    ...
    </select>

    The I looked for the parent element and added the select to call the dropdown only. So in styles it looks like this:

    #cat.postform select to style the dropdown itself

    • This reply was modified 6 years, 1 month ago by bananenkopf.
    • This reply was modified 6 years, 1 month ago by bananenkopf.
    • This reply was modified 6 years, 1 month ago by bananenkopf.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Style wp_dropdown_categories’ is closed to new replies.