How to make front end form only accept certain values

you will probably want to use term_exists http://codex.wordpress.org/Function_Reference/term_exists to check if the term is “valid”. Probably worth checking how good is that API with mismatched cases. Another option is to use AJAX to populated your input control base on the user input. I am almost sure there is some jquery plugin for that, and then … Read more

How to group posts and get a mixed posts and groups view?

A custom taxonomy makes perfect sense – here’s hoping I haven’t missed something: $songs = get_posts( array( ‘post_type’ => ‘song’, ) ); $index = array(); // Build an album_id => songs index foreach ( $songs as $song ) { if ( $albums = get_the_terms( $song->ID, ‘album’ ) ) $index[ $albums[0]->term_id ][] = $song; else $index[ … Read more

How to give all CPT a folder automatically based on their slug

Your second function is wrong. get_post_type($post) excepts the current post object or post ID or any post object or ID given to it. You are using the arguments for get_post_types( $args, $output, $operator ) for get_post_type, which fails the function which in turn gives you the error in your foreach loop. To rectify your function, use something like this: … Read more