katesmith5
asked 10 years ago

I am using wallpress and jigoshop and my index page is shop. how can i set all the links target blank to open links in a new window in my index page?

Kate Smith
replied 10 years ago

something like portfolio or showcase radio button or other way of slider

3 Answers
Wilfred
answered 10 years ago

For all links in index page (shop page) have target is blank, please replace the code I provided above with this new one:

<script>
jQuery(function($){
$('body.page-shop .item-actions .button').bind('click',function(e){
e.preventDefault(); window.open( $(this).attr('href'),'_blank');
return false;
});
$('body.page-shop a').attr('target','_blank');
});
</script>
Wilfred
answered 10 years ago

Hello Kate,
To resolve this issue you can go to Dashboard / Appearance / Customize /Custom Code, and add this code below to Footer Code section:

 <script>
jQuery(function($){
$('.item-actions .button').bind('click',function(e){
e.preventDefault(); window.open( $(this).attr('href'),'_blank');
return false;
});
$('a').attr('target','_blank');
});
</script>

Hope this helps!

Kate Smith
replied 10 years ago

Many Many Thanks. πŸ™‚

Kate Smith
replied 10 years ago

No πŸ™ using this code all the links are target blank, I just want to use the index page (which is my shop) links as a target blank. shop products, shop cetagories, main menu on the index page…

katesmith5
answered 10 years ago

Yes, the second code is working. πŸ™‚

Powered by DW Question & Answer Pro