Star Rating & Filter will be available in picu Pro version 1.5.0.
Custom Stars Color
By default the stars use the color you set in your Design/Appearance settings. It is however possible to define a custom color, just for the stars:
/**
* Use custom stars color.
*/
function my_custom_picu_styles( $custom_styles ) {
ob_start();
?>
:root {
--picu-star-color: gold; // Replace with your custom color
}
<?php
return $custom_styles . ob_get_clean();
}
add_filter( 'picu_brand_customize_styles', 'my_custom_picu_styles' );
Code language: PHP (php)
Deactivate Star Ratings for All Collections
If you do not want to use star ratings and filtering, the following snippet will deactivate it for all collections:
/**
* Disable star rating for all collections.
*/
add_filter( 'picu_use_star_rating', '__return_false' );
Code language: PHP (php)
Deactivate Star Ratings for Some Collections
The snippet below can be used to deactivate star rating and filtering for a predefined set of collection, in this example case for the collections with the IDs 1234
and 5678
.
/**
* Disable star rating for certain collections.
*/
function my_picu_deactivate_star_rating() {
$collections = [ 1234, 5678 ];
if ( in_array( get_the_ID(), $collections ) ) {
return false;
}
return true;
}
add_filter( 'picu_use_star_rating', 'my_picu_deactivate_star_rating' );
Code language: PHP (php)