• Resolved DenisCGN

    (@deniscgn)


    Hello everybody,

    I try to change the author_link only for a special Custom Post Type.

    But the is_singular () does not work. I created the CPT with CPT UI Plugin.

    Here is my code:

    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 it does not check if its the CPT “localhero_profile”?

    Cheers,
    Denis

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Change the “author_link”’ is closed to new replies.