WordPress.org

Ready to get started?Download WordPress

Forums

need wp_dropdown_categories hack: styling for different cat levels (2 posts)

  1. smeat00000
    Member
    Posted 5 years ago #

    Is there a way to define my own styles for top-level (or any other level) categories in wp_dropdown_categories? The current output does not assign css classes to the <option> tags:

    <option value="14">1st Japanese Release</option>
    <option value="25">&nbsp;&nbsp;&nbsp;Helic</option>
    <option value="26">&nbsp;&nbsp;&nbsp;Zenebas</option>
    <option value="27">&nbsp;&nbsp;&nbsp;Guylos/Etc</option>

    I imagine the answer lies somewhere within preg_replace(), but I still can't wrap my mind around regular expressions :(.

    thanks in advance,
    rcm

  2. afshin222
    Member
    Posted 5 years ago #

    Hello,

    I prefer http://codex.wordpress.org/Function_Reference/get_categories
    You can find your question easily just by search!

    Good luck!

Topic Closed

This topic has been closed to new replies.

About this Topic