You just need to add a static <option>
element before you start your loop.
<select style="width: 100px" name="games_database_rating">
<option value="none">No Rating</option>
<?php // Generate all items of drop-down list
for ( $rating = 10; $rating >= 1; $rating -- ) {
?>
<option value="<?php echo $rating; ?>" <?php echo selected( $rating, $game_rating ); ?>>
<?php echo $rating; ?>/10 <?php } ?>
</select>
Now your select
will start out with “No Rating”, and you can still choose a number. When you submit the form, just check for “none” or the number.
Related Posts:
- How to rank custom post type from score points
- Database alteration: users who voted
- Average Rating per Post based on Comment Rating
- Load a script just to custom post type in admin
- Handling front-end file uploads, considering safety and ease of use
- How to set a fall back template for a custom post type in a plugin?
- Post formats “audio” and “video” only showing in index.php
- How do I implement custom fields without using any plugins?
- how do I group content in magazine-style ‘issues’?
- Prepend regular Posts with custom slug, without affecting Custom Post Types?
- Semantic URL Custom Post Type and Taxonomies permalinks
- Pagination with custom loop
- WordPress custom post action hook
- Display metabox conditionally
- Change plugin’s has_archive = true to false?
- How to remove thumbnail sizes for specific post type on a child theme?
- Do attachments added to custom post types have a post parent?
- Get slug to point to different content of the same post
- How to make an archive page displaying posts in a date range
- Categories and Tags not working!
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- category.php displays ALL posts instead of just those with the current category
- Having a 2nd admin page for a custom post type
- Custom Post Custom Taxonomy Data Not Saving in Edit Screen
- Display Next/Prev when looping Custom post-types archive?
- List custom posts by custom taxonomy
- How to Set Post Status to Draft if older than today
- How much control do we have over CPT rewrite slugs? Can I create a “root” page for my CPT with out the page path, and then have paths for other pages?
- Create a post in custom post type using field in registration form after users submit form
- Call custom post type by category
- Archive template not working for custom post type
- How to get updated data when save_post triggers?
- Push metadata in array
- Get template part using a custom taxonomy term
- Displaying custom taxonomy in the admin list of a custom post type
- Make metabox of custom post type fully autosave- and bulk-/quick-edit compatible
- Creating a Custom Post as a repository for theme constants
- Second Set of Eyes: One custom taxonomy shows in Appearance > Menus, one does not
- Hiding posts by other users and non-logged in
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- Several CPT’s with same Taxonomy name but with different Terms for each
- Order Custom Post Type by Custom Field Value
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Get the taxonomy of a post hierarchically
- Query posts based on the meta key values of logged-in users?
- Hierarchical custom fields
- How to order posts of a custom post type by date DESC in dashboard Admin?
- Fields for different parts of a page
- Specifying Mouseover Icon for Custom Post
- Sizing textarea field in custom metabox
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Is there something like has_no_term
- Custom post-type metabox position
- I can’t access custom taxonomy page listing
- Post will not load via ajax
- Displayling list of Custom Post Type Posts
- List of Categories for Custom Post Type
- $post->post_meta not pulling any post in wordpress/php
- WordPress custom API endpoint – how to make the request more flexible
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Need alternative get_posts function for custom post type
- How to get post type information?
- How to display a WordPress Custom Field only on a specific day of the week?
- is it possible in a custom post, create custom fields as well whitin?
- Display registerd taxonomy in admin dashboard
- Take stored email addresses from custom post type & turn into one string
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- How to show multiple images in a slideshow for a portfolio page
- How to eliminate custom posts where the “date” value is expired?
- Pagination in custom post type archive.php not working
- How to filter a matched value with custom key using WP REST API?
- how to display author name in custom post type
- Sort custom post column by generated value?
- create a “add icon” field in taxonomies page
- Custom Post Type Pagination getting 404 error
- How to search through all child taxonomies using WP_Query?
- Custom Post Taxonomy Template Not Loading Properly
- WordPress retrieving $post based on random key in $_POST
- How can I use one instance of page.php to display different custom post types?
- Show ajax form resuslts in page
- How to make “single post” permalink maintain it’s sub-page structure
- Unwanted URL with Custom Post Type
- wp_nav_menu doesn’t seem to work on custom post type pages
- Custom meta box in editor of custom post type not working
- Calling in Post Content via AJAX
- Multiple custom post type and permalink issue
- Using mediaelement to display gallery of audio
- Help ordering custom query by Title, Ascending
- How do I set a specific size for my image?
- group posts by month/date ignore years
- Toggle a metabox based on a selection
- Image paths on custom post types getting /post_type/ added to path
- Problems with custom post type and hierarchical permalinks
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Show custom taxonomies in admin panel under custom post type
- Trying to display next and previous set of posts on separate page (not parent page)
- Limit wordpress posts loop to continue onto another page
- How to add categories to a custom post type using wp_insert_post($new_post);
- Modify permalink of CPT archive to support two taxonomies