Change favorite heart icon

This topic contains 3 replies, has 3 voices, and was last updated by  evocativemedia 5 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: , ,

  • Author
    Posts
  • #495332

    evocativemedia
    Expired Member
    Post count: 28

    Hi,

    In order to make all favorite button consistent in style I need to change the heart icon. More specifically:
    – from <i class=”fas fa-heart”></i>
    – to <i class=”far fa-heart”></i>

    This changes the filled heart to an outline heart.. I was looking in your code in the file ‘includes/post-functions.php’ and came across the code snippet that creates the favorite heart button. A comment there states:

    /**
    * Filter to modify “fas fa-heart” icon
    *
    * You can use this filter to change “fas fa-heart” icon to something else.
    *
    * @since 1.0.0
    * @package GeoDirectory
    */
    $favourite_icon = apply_filters( ‘geodir_favourite_icon’, ‘fas fa-heart’ );

    /**
    * Filter to modify “fas fa-heart” icon for “remove from favorites” link
    *
    * You can use this filter to change “fas fa-heart” icon to something else.
    *
    * @since 1.0.0
    * @package GeoDirectory
    */
    $unfavourite_icon = apply_filters( ‘geodir_unfavourite_icon’, ‘fas fa-heart’ );

    How can I apply these filters in my functions.php?

    #495353

    Kor
    Moderator
    Post count: 16516

    Hi evocativemedia,

    Thanks for your post. I have forwarded this to a developer and he will look into this asap!

    #495597

    Naveen Giri
    Moderator
    Post count: 1559

    Hi, You can add this code in your theme functions.php.

    
        add_filter('geodir_favourite_icon', 'geodir_unfavourite_icon_callback' );
        add_filter('geodir_unfavourite_icon', 'geodir_unfavourite_icon_callback' );
        function geodir_unfavourite_icon_callback(){
            return 'far fa-heart';
        }
    
    #495602

    evocativemedia
    Expired Member
    Post count: 28

    Yes it worked, thank you very much!

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount