• Đoạn code bỏ Feature_item trong Slug Portfolio

    function ah_remove_custom_post_type_slug( $post_link, $post, $leavename ) {
    if ( ! in_array( $post->post_type, array( 'featured_item' ) ) || 'publish' != $post->post_status ) // url featured_item
    return $post_link;
    $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
    return $post_link;
    }
    add_filter( 'post_type_link', 'ah_remove_custom_post_type_slug', 10, 3 );
    function ah_parse_request_tricksy( $query ) {
    if ( ! $query->is_main_query() )
    return;
    if ( 2 != count( $query->query )
    || ! isset( $query->query['page'] ) )
    return;
    if ( ! empty( $query->query['name'] ) )
    $query->set( 'post_type', array( 'post', 'featured_item', 'page' ) );
    }
    add_action( 'pre_get_posts', 'ah_parse_request_tricksy' );

    Ghi chú: để ý dòng số 2 có featured_item là url muốn xoá, bạn để ý thử Portfolio của bạn đang sử dụng và thay cho đung nhé, còn mặc định flatsome là như trên