WordPress.org

Support

Support » Plugins and Hacks » jQuery Archive List Widget » [Resolved] Custom post type categories not shown in the category list?

[Resolved] Custom post type categories not shown in the category list?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Miguel Useche

    @skatox

    Could you give more info? currently i doesn’t show custom categories by default, but you can change it to show posts from other types, by changing this SQL setence post_type='post' to post_type='YOUR_CUSTOM_TYPE' along the source code.

    Thank You for your replay. where can i change this code?

    That does not fix the buildHtml function, where the links are still being set for regular posts. I’m going to dig around and see if I can get this part to also work.

    You can change the code in the jquery-archive-list-widget.php inside the plugin. You should find various instances where you can change the sql query to post_type=’YOUR_CUSTOM_TYPE’.

    Sorry for hijacking the response on this post, but it might be helpful for @vijaykumarvemula to hear how I was able to get the plugin to work with my CPT’s.

    After I changed the sql queries to use my custom post type, I also went and changed the excluded cat line to also include just the taxonomies from my new CPT

    $cats = get_categories(array('child_of' => 0, 'hide_empty' => 1, 'hierarchical' => 1, 'taxonomy' => 'YOUR_CUSTOM_TAXONOMY'));

    You will also need to set up the date archive rewrites for your CPT (http://stackoverflow.com/questions/14486792/custom-post-type-yearly-monthly-archive) because WordPress does not include this functionality out of the box.

    The plugin also utilizes the get_the_month and get_the_year functions, which do not support CPT’s. You can find these in the buildHtml function. You will need to change these functions to something like this http://ericholmes.ca/custom-post-type-date-archive-links-in-wordpress/. Just make sure the function loads before it gets called in the plugin. That’s how I was able to make the plugin work for my CPT’s.

    Excluded categories weren’t working when I tested my result, and I realized that I needed to add my custom taxonomy here too:

    {$wpdb->term_taxonomy}.taxonomy = 'YOUR_CUSTOM_TAXONOMY'

    You’ll find this in a couple different parts of the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Custom post type categories not shown in the category list?’ is closed to new replies.
Skip to toolbar