How to display non-hierarchical taxonomy as terms with checkboxes?

I’m not sure, if you already found a solution for this, but when I searched for a similar one yesterday, I found this tutorial on WPtuts very helpful. It uses radio buttons, but you can easily modify it to get it working with checkboxes as well. http://wp.tutsplus.com/tutorials/creative-coding/how-to-use-radio-buttons-with-taxonomies/

How to Check if a Page Exists by URL?

You could make a list of paths to check… $page_paths = array( ‘analysis/firstNamelastName’, ‘exercise/firstNamelastName’ ); Then check if there’s a page object for each of the page paths. foreach( $page_paths as $page_path ) { echo ‘<code>’ . $page_path . ‘</code> ‘ . PHP_EOL; if( ! $page = get_page_by_path( $page_path ) ){ echo ‘Does not exist.’ … Read more

Change custom post type to hierarchical after being registered

And as it usually happens, I find the answer a few minutes after posting the question… So here’s what I did in my theme’s functions.php file to solve my problem: function modify_products() { if ( post_type_exists( ‘product’ ) ) { /* Give products hierarchy (for house plans) */ global $wp_post_types, $wp_rewrite; $wp_post_types[‘product’]->hierarchical = true; $args … Read more

Nested custom post types with permalinks

If you want to keep ‘authors’ as the base slug in the permalinks, i.e. example.com/authors/stephen-king/ for the ‘authors’ CPT, example.com/authors/stephen-king/the-shining/ for the ‘books’ CPT and example.com/authors/stephen-king/the-shining/chapter-3/ for the ‘chapters’ CPT, WordPress will think pretty much everything is an ‘authors’ post or a hierarchical child of an ‘authors’ post and, since that is not the case, … Read more

Get the the top-level parent of a custom taxonomy term

Thanks to Ivaylo for this code, which was based on Bainternet’s answer. The first function below, get_term_top_most_parent, accepts a term and taxonomy and returns the the term’s top-level parent (or the term itself, if it’s parentless); the second function (get_top_parents) works in the loop, and, given a taxonomy, returns an HTML list of the top-level … Read more