Broken Category Icons
This topic contains 16 replies, has 6 voices, and was last updated by gavant 9 years, 9 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: category icons
-
AuthorPosts
-
March 9, 2015 at 1:28 pm #33386
For some reason, since the last update, any new categories that I add, show broken category icons.
March 9, 2015 at 2:10 pm #33390Hi, Please try going into any category and clicking save, let me know if this fixes it.
Stiofan
March 9, 2015 at 2:36 pm #33394No it doesn’t. I’ve also tried deleting the category icon, and re-uploading it. That doesn’t work as well.
March 9, 2015 at 3:56 pm #33414OK 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
March 13, 2015 at 3:21 pm #33945Where exactly are the fixes?? Github isn’t exactly the easiest to understand.
…nevermind….figured it out…
March 13, 2015 at 6:17 pm #33965it 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; }
March 13, 2015 at 6:22 pm #33967Yep, thanks. I figured it out and integrated the fixes without a problem.
March 13, 2015 at 11:30 pm #33998Just 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
March 14, 2015 at 9:23 pm #34032Hi, i’ve tried this update too, but it didn’t fix the issue i had with the icons, thanks.
March 15, 2015 at 2:34 am #340361) 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″}
March 15, 2015 at 7:22 pm #34060Is GeoDirectory going to release a fix soon? Launching site tomorrow and this really is a buzz killer.. need the custom map markers.
March 15, 2015 at 8:10 pm #34062I tried that replacing the code in the taxonomy_update.php file and the site didn’t come up right.. just a background… any ideas?
March 15, 2015 at 8:13 pm #34064I 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/
March 15, 2015 at 8:17 pm #34065Great – will give that a try… thanks!
March 16, 2015 at 2:34 pm #34121okay..modifying the two files did fix.. had to save category after fix… works now 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket