is_singular and CPT
-
Hello,
I try to check if the single page is a Custom Post Type “locahero_profile”.
I created the CPT with the plugin.When I try to change the author_link on this special CPT nothing happens.
function my_author_link( $link ) { if ( is_singular( 'localhero_profile' ) ) { global $post; $profile_ID = get_user_meta($post->ID, '_cptID', true); $link = get_permalink( $profile_ID ); return $link; } else { return 'HELLO'; } } add_filter( 'author_link', 'my_author_link', 10, 1 );
Any suggestion why the CPT is not checked? Did I miss some settings?
Cheers,
Denis
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘is_singular and CPT’ is closed to new replies.