Is there a way to lay this out so it will fit better?

Please see attached screenshot..

If you look at the 'All listing categories' box on the left when adding a listing to my directory, I've begun to add breeds of dogs underneath the 'dog breeders' section. But I can foresee a problem. Adding over 100 breeds of dogs is going to make the content of this box ridiculously long and impractical to scroll through when wanting to add a listing for lets say a dog groomer.

Is there a way to lay this box out differently, or is there a way to make a separate directory just for dog breeders using this one installation of 'directory'?

I don't want my site to look messy because of one huge list of dog breeders on this page or the Link removed at members request page basically.

What are my options? Perhaps I could replace this box with a dropdown box which only displays the top levels until each top level is clicked on? Is this an option?

Thanks

Sally

  • Sally
    • The Crimson Coder

    Hi @Jack Kitterhing

    Dog breeders would be a category within the directory, would that work?

    Can you exclude a category within a directory on one page but show it on another? How would this be possible because if it is, it sounds like a nice simple solution :slight_smile:

    Thanks

    Sally

  • Sally
    • The Crimson Coder

    Hi @Jack

    Ah so are you saying that in the place of the parent category ie 'Dog Breeders' I could make that linkable to another page which would contain a clickable list of breeds, which when any of those were clicked on would take the user to a page just displaying breeders of that breed of dogs?

    If so, that would be ideal, how would I do that please?

    Thanks

    Sally

  • Sally
    • The Crimson Coder

    Hi @Jack

    Thanks for the advice.

    How would I stop these categories from displaying on the lists at Link removed at members request if I did this?

    Or would I be able to make one of the blue clickable links within the lists appear as the 'Dog Breeders' text? (without the list of breeds beneath it on that page)

    Thanks

    Sally

  • Sally
    • The Crimson Coder

    Hi @Jack Kitterhing

    Yes that would work, but how would I stop all the child categories of actual dog breeds from displaying underneath the dog breeders text on Link removed at members request ?

    Or could I insert a drop down list of dog breeds below that title? If so, how would I do that? I just don't want over 100 dog breeds to stretch my page really long and ruin the appearance. Plus when someone adds a listing, I don't want them to have to scroll through hundreds of dog breeds to get to the part where they would click to list a dog bandana for example.

    Thanks

    Sally

  • Sally
    • The Crimson Coder

    Hi @Jack Kitterhing

    In live chat the other night, @Vinod Dalvi said he knew how I could simply display the dog breeders category on a separate page and omit them from the Link removed at members request page.

    Is there a way to get him on here to find out what his method was?

    He wanted me to first get the categories (taxonomys) I wanted showing on the directory page using my child themes functions.php, then let me know how I did that and he would tell me how to get this separate page up and running once that was done. I have the correct categories showing now, so I'm ready to do this. As you can see, I've added just a few of the dog breeds to the dog breeders category and it's already messy. So if I can get this sorted now that would be great :slight_smile:

    Thanks

    Sally

  • Sally
    • The Crimson Coder

    Hi @Vinod Dalvi

    Thanks for replying!

    It's the directory plugin and I'm using the shortcode [dr_list_categories style="grid"] It's a manually created page, not the default one created by the plugin.

    I'm also using the methods mentioned at the base of this thread https://premium.wpmudev.org/forums/topic/wrong-categories-showing-in-directory-page in order to only display the listing_category category on that page.

    Thanks

    Sally

  • Vinod Dalvi
    • WP Unicorn

    Hi Sally,

    To hide all the child categories of actual dog breeds from displaying underneath the dog breeders text on Link removed at members request using the shortcode [dr_list_categories style="grid"] make following changes in directory plugin.

    In the following plugin file change empty to !isset on line number 183 as displayed below.

    directory/ui-admin/settings-general.php

    Before Editing:
    <input type="text" name="count_sub_cat" id="count_sub_cat" value="<?php echo ( empty( $options['count_sub_cat'] ) ) ? '5' : $options['count_sub_cat']; ?>" size="2" />

    After Editing:
    <input type="text" name="count_sub_cat" id="count_sub_cat" value="<?php echo ( !isset( $options['count_sub_cat'] ) ) ? '5' : $options['count_sub_cat']; ?>" size="2" />

    In the following plugin file make the changes on line numbers 23 and 77 as displayed below.

    directory/core/template-tags.php

    Before Editing on line number 23:
    $sub_cat_num = ( isset( $options['general']['count_sub_cat'] ) && is_numeric( $options['general']['count_sub_cat'] ) && 0 = $options['general']['count_sub_cat'] ) ? $options['general']['count_sub_cat'] : 5;

    After Editing on line number 23:
    $sub_cat_num = ( isset( $options['general']['count_sub_cat'] ) && is_numeric( $options['general']['count_sub_cat'] ) && 0 <= $options['general']['count_sub_cat'] ) ? $options['general']['count_sub_cat'] : 5;

    Before Editing on line numbers 77:

    $output .=   wp_list_categories($args);

    After Editing on line numbers 77:

    if($sub_cat_num)
     $output .=   wp_list_categories($args);

    After making the above changes just set Count of sub-category to 0 in the Directory Settings on the following path as displayed in the attached screenshot.

    Admin area -> Listings -> Settings -> General tab -> Display Options

    I have notified the plugin developer to add this in the future version of plugin so that sub categories can be removed.

    Cheers,
    Vinod Dalvi

  • Sally
    • The Crimson Coder

    Hi @Vinod Dalvi

    Thanks for getting back to me.

    Ok, if I make these changes, the dog breeds will disppear, but will all the other child categories beneath parent categories on Link removed at members request also disappear? I don't want them to go.

    Also, where will people be able to see the dog breeds child categories once this is done? Do I need to create a new page for that?

    Thanks

    Sally

  • Vinod Dalvi
    • WP Unicorn

    Hi Sally,

    Ok, if I make these changes, the dog breeds will disppear, but will all the other child categories beneath parent categories on Link removed at members request also disappear? I don't want them to go.

    Yes after making these changes it will hide all the child categories as i have developed generic functionality as a plugin feature.

    If you only want to hide the child categories of "Dog Breeders" then in the following directory plugin file make the changes on line number 77 as displayed below.

    directory/core/template-tags.php

    Before Editing on line numbers 77:
    $output .= wp_list_categories($args);

    After Editing on line numbers 77:

    $exclude_cat = get_term_by('slug', 'dog-breeders', 'listing_category');
    if( $category->term_id != $exclude_cat->term_id  )
    	$output .=   wp_list_categories($args);

    Also, where will people be able to see the dog breeds child categories once this is done? Do I need to create a new page for that?

    Yes as discussed in the live chat session please create a new template loop-taxonomy.php and add the provided code in it in if condition to display child categories only for dog breeders category.

    Regards,
    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Sally,

    Thank you for your reply.

    Actually what you want to achieve is a specific requirements so our directory plugin doesn't provide the functionality to achieve it out of the box.

    You will have to develop custom code to achieve it or if you find any plugin to do this then you can use that. You can consider hiring a developer from https://premium.wpmudev.org/wpmu-custom-development/ to develop custom code for it.

    Thank you for being a WPMU DEV member and have a great day!

    Cheers,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.