X_recent_posts type="post" - NEW BROWSER TAB

I have this web page built using X theme:

Underneath the large header, you’ll see two columns of blog postings with images.
When someone clicks on the blog posting, I’d like a user to be navigated to a
new browser tab.

The dual-column of posts was created using this layout of code:
[x_recent_posts type=“post” count = 2 offset=2 category=‘blog’ enable_excerpt=“true” show_excerpt=‘true’]

repeatedly, and shifting the offset by 2.

My question is HOW do I change this x_recent_posts code so that when a user clicks on a URL, it opens content into a new browser tab rather than using the existing browser tab?

Thx in advance!

Hi Gregory,

Thank you for writing in, since the target="blank" attribute does not work in recent posts. Please add a class="newtab" attribute to your shortcode instead.

example:
[x_recent_posts type="post" count="2" offset="2" category="blog" enable_excerpt="true" show_excerpt="true" class="newtab"]

Then add this to the Page > JS

jQuery(document).ready(function($){
$('.newtab a').attr('target', '_blank');
});

Please be reminded that this is custom code, further customization from here won’t be supported.

Hope it helps,
Cheers!

AWESOME! Thank you!

You’re welcome! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.