WordPress.org

Forums

Quick Post Widget
Change Checkbox input to Radio Buttons (1 post)

  1. mjd2
    Member
    Posted 1 year ago #

    Id like to make it so only one category can be selected at a time by using radio buttons. I've found the code that I think needs to be edited:

    <?php
          $category_ids = get_all_category_ids();
          foreach($category_ids as $cat_id) {
          $cat_name = get_cat_name($cat_id);
          echo '<div class="categoryBox">
               <input type="checkbox" name="piw_cat[]"  value="'.$cat_id.'" class="categoryCheckBox" /> '.$cat_name.'
                </div>';
    
       }
    ?>

    I can see that the value needs to go back in 'piw_cat[]'? Sorry if I don't know the lingo. I'm a neophyte when it comes to php so any help would be much appreciated. Thank you!

    https://wordpress.org/plugins/quick-post-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic