The title swapping only works on the second argument of those functions. You have %title
in the argument for excluded_terms
. Try this instead:
$previous_text = '<span class="meta-nav">' . _x( '←', 'Previous post link', 'formationpro' ) .'</span> %title'
$next_text = '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'formationpro' ). '</span>'
previous_post_link( '<div class="nav-previous">%link</div>', $previous_text, 7);
next_post_link( '<div class="nav-next">%link</div>', $next_text, 7);
Or if you prefer to keep them in your format:
<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'formationpro' ) . '</span> %title', 7 ); ?>
<?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'formationpro' ) . '</span>', 7 ); ?>