• I’ve got a custom post type for which I wanted to modify the URL

    function events_permalink_structure($post_link, $post){
    
    	$types=wp_get_object_terms( $post->ID, 'post_types' );
        if (( 'animation' == $types[0]->slug )or ( 'comic' == $types[0]->slug )) {
    		$post_link = str_replace( array('/anime/','/manga/'), '/'.$types[0]->slug.'/', $post_link );
        }
        return $post_link;
    }

    When I save my post, the permalink generates properly.Just one problem, calling the URL return a 404. Is there a custom rewrite rule I need to put in place in addition to the filter.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘post_type_link 404 error’ is closed to new replies.