GeckoGrafix
1/20/2018 - 9:19 AM

change icons in strong testimonials

Changes the Stars to Chef Hats in the Strong testimonials plugin

/**
 * Display:
 * Skip loading the star rating stylesheet in Strong Testimonials.
 */
function my_skip_display_ratings_style() {
	wp_deregister_style( 'wpmtst-rating-display' );
}
add_action( 'wp_enqueue_scripts', 'my_skip_display_ratings_style', 11 );


/**
 * Form:
 * Skip loading the star rating stylesheet in Strong Testimonials.
 */
function my_skip_form_ratings_style() {
	wp_deregister_style( 'wpmtst-rating-form' );
}
add_action( 'wp_enqueue_scripts', 'my_skip_form_ratings_style', 11 );
/*----------------------------------------
Rating display in view
----------------------------------------*/

.strong-view .strong-rating span.star {
  display: inline-block;
  width: 34px; /* = image size + padding */
  height: 34px;
  padding: 5px;
  background-image: url("images/chef-hat.svg");
  background-size: 24px 24px;
  background-repeat: no-repeat;
  background-position: center;
}

/* turn off stars after the current rating */
.strong-rating span.current ~ span.star {
  opacity: 0.4;
}

/*----------------------------------------
Rating input on form
----------------------------------------*/

/* the fieldset */
.strong-form .strong-rating {
  display: inline-block;
  border: 0;
  margin: 0;
  padding: 5px;
}

.strong-form .strong-rating:focus {
  outline: 1px solid #CCC;
}

/* the icons */
.strong-form .strong-rating input[type=radio] {
  display: none !important;
}

.strong-form .strong-rating label {
  display: inline-block;
  width: 34px; /* = image size + padding */
  height: 34px;
  padding: 5px;
  background-image: url("images/chef-hat.svg");
  background-size: 24px 24px;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
}

.strong-form .strong-rating label[for$="star0"] {
  display: none !important;
}

/* and turn all on */
.strong-form .strong-rating label {
  opacity: 1;
}

/* turn off stars after the one we're on */
.strong-form .strong-rating label:hover ~ label {
  opacity: 0.4;
}

/* turn off stars after the current rating */
.strong-form .strong-rating input:checked ~ label {
  opacity: 0.4;
}

/* turn on the current rating */
.strong-form .strong-rating input[type="radio"]:checked + label {
  opacity: 1;
}

/* when hovering the entire fieldset: */

/* (1) turn all on */
.strong-form .strong-rating:hover input ~ label {
  opacity: 1;
}

/* (2) indicate current selection (optional) */
.strong-form .strong-rating:hover input:checked + label:before {
  opacity: 1;
}

/* (3) then turn off siblings after the hovered star */
.strong-form .strong-rating:hover label:hover ~ input:not(:checked) + label {
  opacity: 0.4;
}