diff --git a/classes/class-archive-mapping.php b/classes/class-archive-mapping.php index 2abd0be1..fdafa951 100644 --- a/classes/class-archive-mapping.php +++ b/classes/class-archive-mapping.php @@ -1065,8 +1065,8 @@ public static function create_archive_page( $custom_slug = 'portfolio' ) { 'post_name' => $custom_slug, ); - // Insert the post into the database. - $post_id = wp_insert_post( $args ); + // Check page if Archive Exist and set as Portfolio page or Insert the post into the database. + $post_id = self::get_unset_archive_page() ?? wp_insert_post( $args ); if ( ! is_wp_error( $post_id ) ) {