Broken Category Icons

This topic contains 16 replies, has 6 voices, and was last updated by  gavant 9 years, 8 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #33386

    robnh
    Buyer
    Post count: 57

    For some reason, since the last update, any new categories that I add, show broken category icons.

    http://www.themeadery.net/commercial-meaderies/

    #33390

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi, Please try going into any category and clicking save, let me know if this fixes it.

    Stiofan

    #33394

    robnh
    Buyer
    Post count: 57

    No it doesn’t. I’ve also tried deleting the category icon, and re-uploading it. That doesn’t work as well.

    #33414

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    OK thanks, i have look into it further and it was a bug, you can find the changes here: https://github.com/GeoDirectory/geodirectory/commit/5208f06182361c0fbd5e11e0febc9d99e5d358bb

    You can provide wp-admin details and i will apply the fix if you are not sure or the release will be out tomorrow.

    Thanks,

    Stiofan

    #33945

    robnh
    Buyer
    Post count: 57

    Where exactly are the fixes?? Github isn’t exactly the easiest to understand.

    …nevermind….figured it out…

    #33965

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    it takes a bit of getting sued too sorry, it’s hard to know everyones skill level.

    Basically replace this functions at the very end to the taxonomy_functions.php file

    
    
    function geodir_get_term_icon($term_id = false,$rebuild=false)
    {
        global $wpdb;
    	if(!$rebuild){$terms_icons = get_option('gd_term_icons');}
    	else{$terms_icons = '';}
    
    	if(empty($terms_icons)){
    		$default_icon_url = get_option('geodir_default_marker_icon');
    		$taxonomy = geodir_get_taxonomies();
            $post_types = geodir_get_posttypes();
            $tax_arr = array();
            foreach($post_types as $post_type){
                $tax_arr[]= "'".$post_type."category'";
            }
            $tax_c = implode(',',$tax_arr);
            $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)");
    		//$terms = get_terms( $taxonomy );
    
            //print_r($terms );exit;
    
    		foreach( $terms as $term ) {
    			$post_type = str_replace("category", "", $term->taxonomy);
    			$a_terms[$post_type][] = $term;
    
    		}
    
    		foreach ($a_terms as $pt=>$t2) {
    
    			foreach ($t2 as $term) {
    
    				//print_r($term);
    				$term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt);
    				if ($term_icon) {
    					$term_icon_url = $term_icon["src"];
    				} else {
    					$term_icon_url = $default_icon_url;
    				}
    				$terms_icons[$term->term_id] = $term_icon_url;
    			}
    		}
    
    		update_option('gd_term_icons',$terms_icons);
    	}
    
    	if ($term_id && isset($terms_icons[$term_id])) {
    		return $terms_icons[$term_id];
    	}elseif($term_id && !isset($terms_icons[$term_id])) {
    		return get_option('geodir_default_marker_icon');
    	}
    
    	return $terms_icons;
    }
    #33967

    robnh
    Buyer
    Post count: 57

    Yep, thanks. I figured it out and integrated the fixes without a problem.

    #33998

    rosarnach
    Expired Member
    Post count: 71

    Just an FYI – my custom category icons too bizarrely reverted back to the standard red Google pin.

    I replaced the geodir_get_term_icon function as noted above to no avail. I also tried updating the category with a different icon to no avail.

    David

    #34032

    will-wink
    Expired Member
    Post count: 33

    Hi, i’ve tried this update too, but it didn’t fix the issue i had with the icons, thanks.

    #34036

    gavant
    Expired Member
    Post count: 3

    1) I created a category and added a marker icon.
    2) I changed the icon to a new image because I did not like the first one.
    3) Icon no longer displayed.

    It appears that when you update an icon the JSON is not getting updated. If I look in wp_8bhnbd8qbv_geodir_post_icon the JSON shows the href to the old icon. The updated icon should be “pin-generic-red1.png”. Since “pin-generic-red.png” was removed, no icon appears on the maps after an update is made.

    {“id”:”48″,”lat_pos”: “18.452874459610076”,”long_pos”: “-66.04864308317872″,”marker_id”:”48_5″,”icon”:”http://1d4.f72.myftpupload.com/wp-content/uploads/2015/03/pin-generic-red.png”,”group”:”catgroup5″}

    #34060

    Will
    Full Member
    Post count: 79

    Is GeoDirectory going to release a fix soon? Launching site tomorrow and this really is a buzz killer.. need the custom map markers.

    #34062

    Will
    Full Member
    Post count: 79

    I tried that replacing the code in the taxonomy_update.php file and the site didn’t come up right.. just a background… any ideas?

    #34064

    will-wink
    Expired Member
    Post count: 33

    I did the fix in this post, then opened a category and updated it (without changing anything) and it worked. 2 files need to be updated

    https://wpgeodirectory.com/support/topic/split-icons-not-shown-on-maps-or-popular-categories/

    #34065

    gavant
    Expired Member
    Post count: 3

    Great – will give that a try… thanks!

    #34121

    Will
    Full Member
    Post count: 79

    okay..modifying the two files did fix.. had to save category after fix… works now 🙂

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