diff --git a/assets/css/adventure.css b/assets/css/adventure.css index 2cb9757..917a20b 100644 --- a/assets/css/adventure.css +++ b/assets/css/adventure.css @@ -4,6 +4,12 @@ width: 100%; } +.comment-form .comment-form-rating-select { + width: 50%; + padding-right: 15px; + margin-bottom: 0; +} + .comment-form input { margin-bottom: 1rem; } diff --git a/includes/functions.php b/includes/functions.php index c457579..7440510 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -158,22 +158,53 @@ function amp_travel_enqueue_styles() { } add_action( 'wp_enqueue_scripts', 'amp_travel_enqueue_styles' ); + /** - * Add rating field to comments. + * Add star rating field to comments. */ -function amp_travel_comment_rating_field() { +function amp_travel_comment_star_rating_field() { ?>
+ + + '; +} + +/** + * Add star or select rating field to comments. + */ +function amp_travel_comment_rating_field() { + global $is_IE; + if ( true === $is_IE ) { + // add the legacy select field type. + amp_travel_comment_select_rating_field(); + } else { + // add the star rating field type. + amp_travel_comment_star_rating_field(); + } +} add_action( 'comment_form_logged_in_after', 'amp_travel_comment_rating_field' ); add_action( 'comment_form_after_fields', 'amp_travel_comment_rating_field' );