Compare Two Custom Post Types Using The Same Custom Taxonomy

Don’t use get_the_term_list() as it returns an HTML string, which makes comparing more difficult. Use wp_get_post_terms() (Codex link) instead. It can return an array, and then you can use something like array_intersect() to get the terms that match. Your code should look something like this (I haven’t tested this): $course_terms = wp_get_post_terms($course_post_id, ‘course_type’. array(‘fields’=>’slug’)); $testimonial_terms … Read more

Installed Forca Theme, wonder how I can alter Post editing screen

It sounds like you want register_taxonomy_for_object_type to add the taxonomy to the “Page” post type. register_taxonomy_for_object_type(‘events-cat’,’page’); As noted, I don’t know how you expect this to work. You are going to have to alter the page templates. I would also suggest that you look into the Template Hierarchy, in particular the part about custom taxonomies. … Read more

Looking up custom taxonomy IDs by name

I just ran a quick test on a site that uses custom taxonomies. The sample code that you used works for me. I did the following $test_term_by = get_term_by(‘name’, ‘Sample Name’, ‘my-custom-taxonomy’); // note that this produces a “stdclass object”, not an array. echo ‘<pre>’; print_r($test_term_by); echo ‘</pre>’; echo $test_term_by->term_taxonomy_id; // one of the values … Read more