I’m very new at this. So what I’ve manage to do so far. I’ve used the following code to generate a element with all my first level categories:

 <?php
    $args = array(
        'show_option_all'    => 'Blog Categories',
        'show_option_none'   => '',
        'option_none_value'  => '-1',
        'orderby'            => 'ID',
        'order'              => 'ASC',
        'show_count'         => 0,
        'hide_empty'         => 0,
        'child_of'           => 0,
        'exclude'            => '',
        'include'            => '4,2,3,5,6',
        'echo'               => 1,
        'selected'           => 0,
        'hierarchical'       => 1,
        'name'               => 'cat',
        'id'                 => 'cat-blog',
        'class'              => 'form-control mt33',
        'depth'              => 0,
        'tab_index'          => 0,
        'taxonomy'           => 'category',
        'hide_if_empty'      => false,
        'value_field'        => 'term_id',
    );
    wp_dropdown_categories( $args );
    ?>

But unfortunately I can’t manage to add a to all the tags generated by wp_dropdown_categories function.

Is it possible to add a link for every generated category. I want to redirect the users to selected category page.

Thanks in advance
Alex

Read more here: Add a link to <option> elements generated by wp_dropdown_categories()


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: