Change category icons on detail page

This topic contains 5 replies, has 2 voices, and was last updated by  adminparentland-pt 5 years, 11 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #477642

    adminparentland-pt
    Expired Member
    Post count: 172

    Hi,

    Is this still working on V2?

    
    // Change category icon on detail page
    function _gd_custom_detail_page_category_icon( $terms_icons, $term_id ) {
        if ( ! empty( $terms_icons ) && ( geodir_is_page( 'detail' )  || geodir_is_page( 'preview' ) ) ) {
             // $terms_icons['TERM_ID'] = 'CATEGORY ICON URL';
             $terms_icons['946'] = 'http://mysite.com/wp-content/uploads/2018/01/new-hospital-icon.png';
        }
        return $terms_icons;
    }
    add_filter( 'geodir_get_term_icons', '_gd_custom_detail_page_category_icon', 10, 2 );
    

    From https://wpgeodirectory.com/support/topic/change-category-icons-on-detail-page/page/2/

    #477740

    Alex Rollin
    Moderator
    Post count: 27815

    No, V1 snippets by and large don’t work with V2.

    Can you describe your use case?

    #477754

    adminparentland-pt
    Expired Member
    Post count: 172

    Hi,

    I wish to change the icons of the categories just on the homepage (below the search bar). The default icons are good as map markers, but don’t look good on the homepage.

    Thanks
    Andre

    #477820

    Alex Rollin
    Moderator
    Post count: 27815

    The other option is to set a font awesome icon:
    https://wpgeodirectory.com/docs-v2/places/categories/#settings

    #477830

    adminparentland-pt
    Expired Member
    Post count: 172

    But that would change the icon in both the homepage (category listing) and maps, right?
    What I want is to keep the map markers as they are, but get a nice good looking icons for the category listing.
    I understand this was possible with V1 using hooks and the above-mentioned code snippet; is something like that possible? Or anything else?

    #477832

    adminparentland-pt
    Expired Member
    Post count: 172

    Now I see what you meant, the FA icon is alternative and will be used on the widget. That could work!
    Thanks!

Viewing 6 posts - 1 through 6 (of 6 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