How do I show Listing Categories on a theme slider that's meant for WP Categories?

I'm using the Directory plugin on a non-WPMU theme. The theme has a slider on the home page and the option of choosing which featured category gets displayed there. However, the listing categories don't seem to be an option and even when I select one of the regular WP categories, the slider will only show ALL posts. I've tried disabling everything except for Directory. I've also used CustomPress to allow the custom post type of "directory_listing" to support regular taxonomies. Can someone point me in the right direction? To me, it just seems to be a matter of making my theme "see" the directory categories. Is there something I could replace "php the_category()" with ~ like maybe a "php listing_category()" or something?

  • aecnu

    Greetings jason_brown,

    Welcome to WPMU Dev!

    Thank you for this great question and a significant item to bring up.

    This is clearly custom coding that is indeed outside of the scope of the support that we provide here.

    However, I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us but after you let me know if you are going to stay with the new release that may may our work here irrelevant.

    I believe it is in your best interest to be working with the newest rework of the Directory plugin located here: https://premium.wpmudev.org/forums/topic/importing-listings-into-directory#post-277647 rather then work with custom coding the categories

    Please advise if you are going to stick with the current version in which I will ping the lead developer to this ticket or if you are going to try out the RC version which means any day now it will be a full blown release?

    Please advise.

    Cheers, Joe

  • jason_brown

    Thanks for the quick reply Joe! Much appreciated!

    I will gladly try out the RC version. I'll get that installed sometime today.

    It seems I'm always running into the "custom" side of things and I definitely understand the line between "support" and "custom". I apologize if it sounded like I was asking too much ~ I know it's impossible to answer everyone's custom requests. I was just thinking someone might know off the top of their head what the listing categories are called, or where to find them, so I could do my own coding. I guess that's why you're asking the lead developer though... so thanks in advance!

    If it's too involved, I'm ok with finding my own work-around and reposting it here for others if that is allowed.

    Thanks,
    Jason

  • jason_brown

    No problem Joe! I've read a lot of posts here learning about different plugins and such and it just seems that you guys provide very active support without a lot of thanks ~ I know what that's like. I'm just happy for the quick replies and I know that some issues have easy fixes, some are beyond practical solutions, and some are in the fuzzy middle.

    I have the RC installed and still seeing the same reaction. I wonder if there is a way to address it with CustomPress? I've already tried turning the "Support Regular Taxonomies" on and off ~ that didn't work... I'm not sure what the "Capability Type" option is for. It says the default is "post" but mine says "listing". I might try playing with that ~ hopefully I won't break anything...

  • aecnu

    Greetings Jason,

    Thank you again for your input, it is absolutely appreciated.

    Lets go ahead and get to the nitty gritty here by asking the lead developer @Arnold for his advice regarding this issue. He is the Pro that should know.

    I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Arnold

    Might help to know what theme. Each theme has it's own way of doing things. If they don't take into account things like custom post types you'll probably have to change code to get it to work.

    Right now it probably searched for post type "post" or a ategory that you pick. You'd need to change the search arguments to include listings.

    You can try in CustomPress settings the Post types for the different page types, Home, Front etc and see if they willwork but I kind of doubt it.

  • jason_brown

    Hello Arnold,

    I'm using the GazpoMag theme and I'm guessing it doesn't like the custom post types. I haven't found a theme that does.

    This is the code from the theme options page that allows the user to select the category for the "homepage slider":

    function gazpo_cat_list(){
    		$categories = get_categories('hide_empty=0');
    		foreach ($categories as $cat) {
    			if($cat->category_count == '0') {
    				$posts_title = 'No posts!';
    			} elseif($cat->category_count == '1') {
    				$posts_title = '1 post';
    			} else {
    				$posts_title = $cat->category_count . ' posts';
    		}
    		$categories_array[] = array('value'=> $cat->cat_ID, 'title'=> $cat->cat_name . ' ( ' . $posts_title . ' )');
    	  }
    	return $categories_array;
    }

    and then in the options array:

    array(	"name" => "Slider Category",
    			"desc" => "Remember to add Featured image to the category posts. You can see the option in the right column in the New Post page.",
    			 "id" => $shortname."_slider_category",
    			"options" => gazpo_cat_list(),
    			"std" => "0",
    			"type" => "select-cat"),

    It uses the same type of thing for the "featured categories" used on the index page. It seems like it would be easy to change the $categories = get_categories () to something like $categories = get_listing_category(). I tried it and it didn't work at all. I also tried $categories = get_directory_listing() but that didn't work either, so I tried changing it to get_taxonomies and that made the regular categories disappear, but none of the other taxonomies showed up (maybe I was just using them incorrectly...).

    Anyway, thanks a ton for looking at this issue. Like I said earlier, I know this is a bit outside of the normal help question realm, so I really appreciate it!

    Thank you,
    ~Jason

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.