Hyperlinks
-
This is my first time using CPT-onomies, and I might be in over my head!
I have two custom post types: ‘instructor’ and ‘unit’. I have made them into CPT-onomies and associated them with each other. This works beautifully.
I also have a custom taxonomy: ‘course’. This acts like a category for the CPT ‘unit’. That works fine too.
Here are my two questions.
1. I would like to have the name of a unit instructor show on that unit’s post, and hyperlink back to the instructor’s own post. Adapting what I found from this thread, this is what I have so far:
<?php global $cpt_onomy; $instructor_list = get_the_terms( $post->ID, 'instructor' ); if ( $instructor_list && ! is_wp_error( $instructor_list ) ) { foreach ( $instructor_list as $term ) { ?> <span class="instructor">Instructor: <a href="<?php $term->name; ?>"><?php echo $term->name; ?></a></span><?php } } ?>This works well, except for the hyperlink. I tried various adaptations of the hyperlink from the thread to which I linked, but I couldn’t get any of them to work.
Do you have any suggestions, please?
2. I would like to have a list of all the instructors for each of the units within a course display on the course archive page (ideally, with each one hyperlinked too). Do you have any suggestion as to how I might achieve that?
The topic ‘Hyperlinks’ is closed to new replies.