How do I change/edit the categories displayed in detail sidebar?

This topic contains 5 replies, has 3 voices, and was last updated by  Paolo 9 years, 10 months ago.

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

Open Support Ticket

Tagged: , ,

  • Author
    Posts
  • #31842

    Greg McEwan Marriott
    Buyer
    Post count: 36

    Hi

    I managed to find by searching through the core plugin for days (lol) where to replace the category list in main section with category icons as seen below

    Where do I find the code that builds the category list in the detail side bar?

    I would prefer to JUST show the categories in the sidebar and not on the main section?

    I had to edit line 620 onwards in geodirectory_template_actions.php as per code below which is not the way to do it, how can i add this rather in my functions.php?

    
    
    									$links[] = "<a href='".esc_attr( get_term_link($term,$post_taxonomy) ) . "'>$term->name";
    									
    									// **************************************greg************************************** //
    									
    									$linky[] = '<a href='.esc_attr( get_term_link($term,$post_taxonomy) ) . '><img src="http://mysocial.buzz/wp-content/uploads/2014/10/catx_'.$term->name.'.png" alt="'.$term->name.'"/></a>';
    									
    									$terms[] = $term;
    									}
    								endif;
    							}
    							// order alphabetically
    							asort($links);
    							foreach (array_keys($links) as $key) {
    								$termsOrdered[$key] = $terms[$key] ;
    							}
    							$terms = $termsOrdered;
    							
    						}
    					
    						if(!isset($listing_label)){$listing_label='';}
    
    						// **************************************greg************************************** //
    
                            //$taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', ucwords($listing_label.' '. __('Category' , GEODIRECTORY_TEXTDOMAIN)), $links, (object)$terms);
    						$taxonomies[$post_taxonomy] = wp_sprintf('%s %l', ucwords(__('' , GEODIRECTORY_TEXTDOMAIN)), $linky, (object)$terms);
    						
                        }
    #31844

    Greg McEwan Marriott
    Buyer
    Post count: 36

    to get rid of the ‘and’ in the output cat1, cat2, cat3 and cat4 i had to add this to theme functions.php

    
    
    function wpb_adding_scripts() {
    	wp_register_script('place_tag_fix', '/wp-content/themes/buzzbook/js/place_tag_fix.js','','1.1', true);
    	wp_enqueue_script('place_tag_fix');
    }
    add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );

    place_tag_fix.js

    
    
    
    window.onload = function() {
      changeText();
    };
    
    function changeText(){
    	var tags = document.getElementById('geodirtags').innerHTML;
    	var res = tags.replace("and", ""); 
    	document.getElementById('geodirtags').innerHTML = res;
    }
    #31854

    Guust
    Moderator
    Post count: 29970

    To show the categories in the sidebar of the detail page:
    GD > Place (CPT) Settings > custom fields > Field:category (taxonomy) > Show in sidebar > YES.
    When it comes to coding, you are obviously smarter than me 🙂

    #31927

    Paolo
    Site Admin
    Post count: 31206

    please let us know if we can set this as resolved.

    Thx

    #31936

    Greg McEwan Marriott
    Buyer
    Post count: 36

    Hi all, i know about switching off the categories either in the sidebar or details page, but what i am looking for is the page that generates the categories on the sidebar

    #31969

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    as I’m sure you know, we don’t exactly remeber where every line of code is in the plugin especially because there is more that one developer working on it.

    Searching as you noted at the beginning of the thread can take a lot of time, reason why this shouldn’t be expected as part of support.

    I’ve quickly looked and I think it might be in custom_fields_functions.php around line 2451. But I haven’t tested anything myself, so I can’t be 100% sure.

    Let us know how you went.

    Thx

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