Categories and Subcategories

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

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

Open Support Ticket
  • Author
    Posts
  • #55041

    claudiasaraiva
    Expired Member
    Post count: 16

    Hello.
    I’m using the last version of WP and the last version og GeoDirectory v1.5.3…

    I’m having trouble to understand how the categories and subcategories works…

    I created a principal category and added a child category, so when I add a new place I want it to be listed in a way that is shows that structure in the breadcrumb:
    PLACE > CATEGORY A > SUBCATEGORY1
    and not
    PLACE > SUBCATEGORY1

    I want that the NEW PLACE that I created mantains that relationship like FATHER > SON or CATEGORY > SUBCATEGORY.

    What I can do?
    I already tried the different methods in the Field: Categories (taxonomy) – CATEGORY DISPLAY TYPE located in the GEODIRECTORY > LOCAL SETTING in the tab MANAGE LOCAL CUSTOM FIELDS.
    Also to advise that when we choose some of the options for the CATEGORY DISPLAY TYPE in EDITA LOCAL PAGE doesn’t show the structure of CATEGORY > SUBCATEGORY.

    I also tried to set each CATEGORY or SUBCATEGORY as default category, but the problem is that with this option it only shows the CATEGORY selected in the breadcrumbs and not the relationship between category and subcategory that I want…

    Thanks again.
    Cláudia Saraiva

    #55070

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    that is how it works.

    In this demo I have Hotel as Custom post type, 1 star as parent catgeory and hostel as sub category.

    Both the URL and the breadcrumb are showing correctly:

    http://wpgeo.directory/hotels/1-star/hostel/

    Home > Hotels > 1 star > Hostel

    If you provide a link to your webiste with admin credentials we can have a look at your settings.

    Thanks

    #55114

    claudiasaraiva
    Expired Member
    Post count: 16

    Hello.

    I’m using the default PLACE Post Type…

    My demo site is: http://cloudsidea-design.com/DEMOS-SITES/mvm02/

    The example:
    http://cloudsidea-design.com/DEMOS-SITES/mvm02/museu/agricultura-pastoricia-e-aquacultura/viveiro-da-fonte-santa/
    This link is of a place that suposed is linked to the subcategory Agricultura, Pastorícia e Aquacultura that is part of the main category “ECONOMIA LOCAL“:

    The beadcrumbs looks like this:
    Home > Museu > Agricultura, Pastorícia e Aquacultura > Viveiro da Fonte Santa

    And It should be like this:
    Home > Museu > Economia Local > Agricultura, Pastorícia e Aquacultura > Viveiro da Fonte Santa

    It’s necessary to create one Custom Post Type for all the main categories that I need? Doesn’t make sense… for me I guess…

    Thanks for your reply
    Cláudia Saraiva.

    #55131

    claudiasaraiva
    Expired Member
    Post count: 16
    This reply has been marked as private.
    #55220

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    all fixed. Permalinks where correct.

    That listing was only assigned to the sub-category, when both parent category and sub-category must be assigned to the listing for the system to work correctly.

    Thanks

    #55223

    Paolo
    Site Admin
    Post count: 31211

    Actually not, I gave you wrong information, the detail page can only show the default category in the URL, not parent and subcategory.

    There is no way to do that.

    Thanks

    #55364

    claudiasaraiva
    Expired Member
    Post count: 16

    Hi thank you for your reply….

    I insist… ins’t there a way to change the way the geodirectory works with categories and subcategories?

    I need that the structure works with at least 3 levels CATEGORY > SUBCATEGORY > SUB SUB CATEGORY…

    I already tried to create for each MAIN CATEGORY a Custom Post Type… but the problem is the same…

    Thanks again.

    Cláudia Saraiva

    #55408

    Paolo
    Site Admin
    Post count: 31211

    Hi Claudia,

    it is really not possible to have both the location, category and sub-category in the URL.

    It would require a major customization of the plugin.

    Thank you

    #55645

    claudiasaraiva
    Expired Member
    Post count: 16

    Hello…

    Idon’t know you can please se this code…

    I’m still tryng to mage a way to show the category > subcategory structure in the breadcrumbs….

    I know that is not a good pratice to change the code because of future problems with updades.. but well i am trying to get a solution for a problem that i seems is a general request at your forum…

    So please review and gave me your opinion… I’m not a great programmer…

    SO I tried this adjustment in the page at:
    pluginsgeodirectorygeodirectory-functionsgeneral_functions.php

    at line:
    your code: if (geodir_is_page(‘detail’))
    I enter this new one:

    
    
    if (geodir_is_page('detail'))
    
    //the new code
    {
    			
    				$category = get_the_terms( $post_type->ID, $gd_taxonomy );     
    				foreach ( $category as $cat){
    				$cat->name.'  ';
    				$cat->slug. '';
    				}
    				
    				$breadcrumb .= $separator . '<a>slug.'">'.$cat->name.'</a>';
    //end new code
    //code origianl
    $breadcrumb .= $separator . get_the_title();
    $breadcrumb .= '</li>';
    //end code original
    
    // new code
    }

    I know that this option gives me an error…

    The outocome is right and i can view the right levels of the breadcrumbs until the second level, like this:

    CPT CATEGORY > MAIN CATEGORY> SUBCATEGORY > NAME OF POST

    But if i need a new subcategory, gives me a litle error… it jumps a category..
    It’s suposed to write:
    CPT CATEGORY > MAIN CATEGORY> SUBCATEGORY > SUB-SUBCATEGORY > NAME OF POST
    but it jumps a subcategory..
    CPT CATEGORY > MAIN CATEGORY> SUB-SUBCATEGORY > NAME OF POST

    I think it’s possible to wrote a code, not changing a thing in the database, in the general_fucntions.php based on the the WIDGET GD POPULAR POST CATEGORY… because it display all the categories and subcategories…

    I just don’t know how to improve the code at general_functions.php…

    Please advice…

    Thanks

    Cláudia Saraiva

    #55784

    Paolo
    Site Admin
    Post count: 31211

    Hi Claudia,

    This is considered a customization request. Only 2 members out of hudreds requested it and we can’t consider it a general need.

    Currently we are undergoing servers maintenance because yesterday we had a hardware failure and we really don’t have spare time to help with customizations.

    Thanks for your understanding,

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