jQuery Archive List Widget
[resolved] Custom post type categories not shown in the category list? (6 posts)

  1. vijaykumarvemula
    Posted 2 years ago #

    Hi, i am using this plugin. Can anyone help me custom post type categories are not showing in category list.


  2. Miguel Useche
    Plugin Author

    Posted 2 years ago #

    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.

  3. vijaykumarvemula
    Posted 2 years ago #

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

  4. seansean11
    Posted 2 years ago #

    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'.

  5. seansean11
    Posted 2 years ago #

    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.

  6. seansean11
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • jQuery Archive List Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic