book-review-library icon indicating copy to clipboard operation
book-review-library copied to clipboard

Parent Categories?

Open michelliebel opened this issue 7 years ago • 4 comments

Hi! Why is there a parent category option for authors and illustrators, but not for genres and subjects? Can I add that functionality?

Thanks! Michelle

michelliebel avatar Sep 22 '17 01:09 michelliebel

Really the reason was/is cosmetic. There's no specific reason why it's that way, really. All that needs to be changed is flipping hierarchical from false to true here: https://github.com/jazzsequence/book-review-library/blob/master/class-book-reviews.php#L456

and here: https://github.com/jazzsequence/book-review-library/blob/master/class-book-reviews.php#L646

If you want to submit a pull request I'd be happy to merge it in and work on updating a minor release for the .org repo.

jazzsequence avatar Sep 22 '17 17:09 jazzsequence

Got it! Thank you!

michelliebel avatar Sep 24 '17 01:09 michelliebel

How would I go about returning just the child subjects of a designated parent subject? In theory, I'm not expecting you to write code for me. Thanks!

michelliebel avatar Mar 17 '18 22:03 michelliebel

That’s actually a rather complex question. This should get you close: http://www.wpbeginner.com/wp-tutorials/display-subcategories-on-category-pages-in-wordpress/

The difference is that you’re not working with categories but a custom taxonomy. So you’d be using taxonomy_exists and get_taxonomy and related functions rather than the category-specific functions.

jazzsequence avatar Mar 18 '18 03:03 jazzsequence