• Resolved dm_sw

    (@dm_sw)


    Hello,

    I’m using CPT-onomies on a clients site I’m working on.
    I have a CPT of member, which I’m then converting using CPT-onomies. However, the permalink returned is incorrect. It is returning /member/tax/name, rather than /member/name.

    I’m using the code below and wondered if I was missing something really obvious?

    Thanks,
    Steph

    global $cpt_onomy;
    	$terms = wp_get_object_terms( $post->ID, 'member' );
    	if ( $terms && !is_wp_error( $terms ) ) {
    	   foreach ( $terms as $term ) {
    	      $job = '<a href="' . $cpt_onomy->get_term_link( $term, $term->taxonomy ) . '">' . $term->name . '</a>';
    	   }
    	}

    http://ww.wp.xz.cn/plugins/cpt-onomies/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Because your CPT permalink is default-ly member/name, I set it up so the default CPT-onomy term permalink is member/tax/name.

    You can, however, adjust this in your “Register this Custom Post Type as a CPT-onomy” settings in the “Archive Page Slug” field.

    Just make sure your custom post type permalink structure is not the same as your CPT-onomy term permalink structure.

    Thread Starter dm_sw

    (@dm_sw)

    Hello,

    Much appreciated. I had been staring at the screen for too long, I was missing the obvious wasn’t I?!

    Thank you!

    Steph

    No problem. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Wrong Permalink Returned’ is closed to new replies.