Last active
July 24, 2017 23:13
-
-
Save tripflex/e167902de01d21d6a0a852b921f87624 to your computer and use it in GitHub Desktop.
Set custom map icon for featured listings in Listify WordPress theme (for WP Job Manager)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'listify_listing_data', 'smyles_custom_featured_listing_map_icon', 50, 2 ); | |
function smyles_custom_featured_listing_map_icon( $data, $post ){ | |
// Make sure passed $post is WP_Post object | |
if( $post instanceof WP_Post ){ | |
// If listing is featured listing, change icon | |
if( ! empty( $post->_featured ) ){ | |
// Set the icon to use below (@see http://ionicons.com/) | |
$data['icon'] = 'ion-thumbsup'; | |
// Set to "smyles-featured" to use custom CSS (see comments below) | |
$data['term'] = 'smyles-featured'; | |
} | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To customize the color of the icons, add this CSS code to your child theme's CSS and customize to your color of choice: