churchthemes / church-theme-content

The Church Content WordPress plugin provides compatible themes with church-related post types, taxonomies and custom fields.
https://churchthemes.com/plugins/church-content/
GNU General Public License v2.0
58 stars 27 forks source link

Added bible book get_terms ordering #6

Closed radarhere closed 9 years ago

radarhere commented 9 years ago

When calling get_terms("ctc_sermon_book"), the books are listed in alphabetical order. The theme that I was using was using this call to list the books in a sidebar, but I wanted to reorder them into the order of the books of the Bible. I thought that other users might as well.

This pull request adds a filter so that you can call get_terms("ctc_sermon_book", array('orderby'=>'bible_book')) with order ASC or DESC to list the books in Bible order. Books that don't exist in the Bible, presumably typos, are listed at the end.

Also, thanks for this repository!

stevengliebe commented 9 years ago

Thanks for sharing your code.

The plugin doesn't play a role in presenting content so something like this may be better as part of a child theme or possibly the theme framework. I will save your code in case it comes in handy for use in the framework. I have had requests for showing books of the Bible in order (widgets) and may work that into the framework if it would make things easier for theme authors.