Title: Categories
Last modified: November 12, 2017

---

# Categories

 *  [bookblog68](https://wordpress.org/support/users/bookblog68/)
 * (@bookblog68)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/categories-252/)
 * On the single author version you only allow TAGS but there are no CATEGORY choices.
   I separate out my posts by categories. Does the multiple author version allow
   category choices?

Viewing 1 replies (of 1 total)

 *  Plugin Author [mooberrydreams](https://wordpress.org/support/users/mooberrydreams/)
 * (@mooberrydreams)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/categories-252/#post-9674728)
 * Books may be organized by genre, series, or tag. The tags that books are organized
   by are not the same tags that posts are organized by.
 * No versions of Mooberry Book Manager add category organization. Is your goal 
   to include books on the page that lists your categories?
 * This code should do that. Best place to put this code is in the `functions.php`
   file of your child theme. ( see [https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/](https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/)
   if you don’t know what a child theme is or how to create one.)
 *     ```
       add_action('init', 'mbdb_add_category_to_books', 20);
       function mbdb_add_category_to_books() {
           register_taxonomy_for_object_type( 'category', 'mbdb_book');
       }
   
       add_filter( 'pre_get_posts', 'mbdb_add_book_to_category_archive' );
       function mbdb_add_book_to_category_archive( $query ) {
            if( is_category() && $query->is_main_query() && empty( $query->query_vars['suppress_filters'] ) ) {
       	    $post_types = array();
       	    if ( !empty($query->query_vars['post_types'] ) ) {
       		    $post_types = $query->query_vars['post_types'];
       	    }
                  $post_types = $post_types + array('mbdb_book', 'post');
       	   $query->set( 'post_type', $post_types );
       	   return $query;
           }
       }
       ```
   
 * If you also want to display the category on your book page, that is some additional
   code and it will depend where you want to display it.
 * Hope this helps!
    -  This reply was modified 8 years, 7 months ago by [mooberrydreams](https://wordpress.org/support/users/mooberrydreams/).

Viewing 1 replies (of 1 total)

The topic ‘Categories’ is closed to new replies.

 * ![](https://ps.w.org/mooberry-book-manager/assets/icon-128x128.png?rev=1122342)
 * [Mooberry Book Manager](https://wordpress.org/plugins/mooberry-book-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mooberry-book-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mooberry-book-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/mooberry-book-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mooberry-book-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mooberry-book-manager/reviews/)

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)

 * 1 reply
 * 2 participants
 * Last reply from: [mooberrydreams](https://wordpress.org/support/users/mooberrydreams/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/categories-252/#post-9674728)
 * Status: not resolved