Change category icons on detail page

This topic contains 17 replies, has 3 voices, and was last updated by  Kor 6 years, 10 months ago.

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

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #411205

    Tilen
    Expired Member
    Post count: 120

    Hello,

    I want to change place category icons on detail page with function wich checks if default icon is there and then change it with custom icon for every specific category, but doesn’t work:

    i try:

    
    
    add_filter('sd_details_output_cat_links', 'custom_sd_details_output_cat_links');
    
      function custom_sd_details_output_cat_links($cat_links) {
    
      if (file_exists ("<img src='http://dev.zadomace.si/wp-content/uploads/2017/10/zelenjava.png'>")) {
         return "<img src='http://dev.zadomace.si/wp-content/uploads/2017/10/kategorije/zelenjava.png'>";
    
      }
    }

    Can you please help?

    Thanks, T

    #411207

    Kor
    Moderator
    Post count: 16516

    Hi Tilen,

    Thanks for reaching us. Sorry, I’m not really sure what are you trying to achieve there. You should be able to change the category icons directly in the “Places Categories” as shown in the attached screenshot. Is this what you’re looking for?

    Thanks!

    #411211

    Tilen
    Expired Member
    Post count: 120

    Hello,

    on plage category I can change default image of category and icons, but I want to change icons only on detail page with custom icons.

    Thanks for help, T

    #411217

    Kor
    Moderator
    Post count: 16516

    Hi Tilen,

    Thanks for your reply. Yes, this would require customization. However, upon inspecting my test site, it looks like you can manipulate it using custom CSS. Here are some hints. Try targeting the post id if you wish to have different category icons on different listings.

    
    
    .sd-detail-cat-links img {
        display:none!important;
    }
    
    .sd-detail-cat-links  {
        background-image: url("https://wpgeo.directory/supreme-directory/wp-content/uploads/sites/5/2017/01/hotel1-1.png");
        background-size:cover;
        background-repeat: no-repeat;
        width: 50px;
        height: 50px;
    }
    #411222

    Tilen
    Expired Member
    Post count: 120

    Hello,

    thanks for help, I will try.

    T

    #411225

    Tilen
    Expired Member
    Post count: 120

    Hello,

    i can’t find way to change css for specific place category id:

    Some examples for cat ID = 7:

    
    
    .sd-detail-cat-links #7  {}
    .sd-detail-cat-links id-7  {}
    .sd-detail-cat-links cat-7  {}

    Thanks for help,
    T

    #411234

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    Can you clarify what you are trying to do?

    It sounds like you want to change all the category icons that are visible on the detail page.

    Is that right?

    If there are 5 categories, do you then want to change the image for each of the 5 different categories?
    Or do you want all 5 to have the same image?

    #411268

    Tilen
    Expired Member
    Post count: 120

    Hello,

    yes, I want to change category icons only on detail page below the address with custom icons.

    I want to change every category icon with custom icon.

    Thanks for help,

    T

    #411270

    Kor
    Moderator
    Post count: 16516

    Hi Tilen,

    If possible, could you share a detail listing page? I’ll try to work out an example for you. You can use the private reply option below.

    Thanks!

    #411277

    Tilen
    Expired Member
    Post count: 120

    Hello,

    I was edited private post but now doesn’t shows it. Did you get private message?

    Thanks for answer,

    T

    #411278

    Kor
    Moderator
    Post count: 16516
    This reply has been marked as private.
    #411283

    Tilen
    Expired Member
    Post count: 120
    This reply has been marked as private.
    #411315

    Kor
    Moderator
    Post count: 16516

    Hi Tilen,

    Just checked your Website and it looks like it’s not possible to achieve this using custom CSS. I’ve already informed a developer and he will check this out tomorrow for you.

    Thanks!

    #411317

    Tilen
    Expired Member
    Post count: 120

    Hello,

    thanks for answer, I find this part of code in geodirectory-compatibility.php and try to achieve this with php filter to check and change category images only on that part of site, but it doesn’t work.

    Thanks for help,

    T

    #411318

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    We have looked into this. We are working towards several related features in V2, and for now we have a filter that you can use:

    
    
    
    apply_filters('geodir_get_term_icons', $terms_icons, $term_id);
    

    You will need to write your own customization to make use of that filter to switch the category icons.

    Let us know how it goes, and if you need to hire an expert check out https://geodirectoryexperts.com

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