I will be using a forum plugin and would like to display some of the topics from the forum on different pages via short-codes. The only thing is that once clicked they will open up in the same page. Is there a way to force links to open in a new window?
Make sure that the links are within a div ID eg "blank_div", use the JS below to add a 'target'='_blank' to ALL the links within that div ID.
$('#blank_div a').attr('target', '_blank');
jQuery is probably the easiest way.
If using WordPress, you can also filter the content. See this example: https://wordpress.org/support/topic/change-all-external-links-to-open-in-new-window-or-tab#post-5355664 ...it seems a little messy though.
I'd personally just use jQuery, @denisb's code snippet will work fine (assuming you have jQuery included elsewhere on the page).