This snippet lets you change the color of a sales badge
Read here to find out about how to add code snippets to your site.
/**
* Change badge color
*
*/
function custom_wpsight_get_offer_color( $color ) {
// possible settings. Choose the one you need and remove the other one if not needed
$color[ 'sale' ] = '#ff0000'; // new hex code of the color for the badge
$color[ 'rent' ] = '#ffff00'; // new hex code of the color for the badge
return $color;
}
add_filter( 'wpsight_get_offer_color', 'custom_wpsight_get_offer_color');
Other articles in Snippets
- Snippet: Add Custom Listing Detail with Pre-defined Options
- Snippet: Add Custom Listing Details
- Snippet: Add custom listing offer
- Snippet: Add custom text (from) before price
- Snippet: Change Advanced Search Form Labels
- Snippet: Change Archive Title
- Snippet: Change Color of Sales Badge
- Snippet: Change Default Search Form Labels
- Snippet: Change Details of the Listing Summary
- Snippet: Change Labels of Listing Post Type
- Snippet: Change Placeholder Text of the Keyword Search Field
- Snippet: Custom Advanced Search Fields
- Snippet: Custom Listing Category Taxonomy Slug
- Snippet: Custom Listing Feature Taxonomy Slug
- Snippet: Custom Listing Location Taxonomy Slug
- Snippet: Custom Listing Post Type Slug
- Snippet: Custom Listing Type Taxonomy Slug
- Snippet: Custom number of baths and beds in Listing Details
- Snippet: Custom number of features in search form
- Snippet: Disable Visual Editor on Listings Page
- Snippet: Display advanced search fields by default
- Snippet: Make Listing Type Taxonomy hierarchical
- Snippet: Modify Measurements
- Snippet: Only Display Keyword Search in Property Search Form
- Snippet: Re-order fields in search form
- Snippet: Remove ‘Offer’ from Property Search Form
- Snippet: Remove Features from Search Form
- Snippet: Search Exact Value of Bathrooms
- Snippet: Search Exact Value of Bedrooms
- Snippet: Set specific offer as default in listing price metabox
- Snippet: Show Different Offer Badge when Listing Item is not Available
- Using Code Snippets