I succeed do what I wanted.
Simply I inserted the function the_id();
in Div 1
and Div 2
.
Div 1:
<a href="#<?php the_id(); ?>" class="portfolio-link" data-toggle="modal">
Div 2:
<div class="portfolio-modal modal fade" id="<?php the_id(); ?> tabindex="-1" role="dialog" aria-hidden="true">