Hi, I want to show the downloads as pdf in a new tab. Do i have a chance to show pdf in new tab?
Home > Community > Forums > Free Downloads WooCommerce
How to show pdf in a new tab
Posted by: HAMZA ÖZAD
3rd January 2021, 6:05 am
-
Developer
Hi Hamza, you could force all free downloads to run in a new tab by using the following snippet. I recommend the Code Snippets plugin to create the snippet for the site.
add_action('wp_footer', 'custom_always_open_free_downloads_in_new_tab'); function custom_always_open_free_downloads_in_new_tab() { ob_start(); ?> <script> (function($) { $(document).ready(function() { $('form.somdn-download-form').each(function() { $(this).attr('target', '_blank'); }); }); })( jQuery ); </script> <?php $content = ob_get_clean(); echo $content; }
Last modified: 4th January 2021, 10:30 am by Richard Webster
Latest Topics
-
Posted by HAMZA ÖZAD
3 Jan 2021, 6:05 amForum: Free Downloads WooCommerce -
Posted by nerdontour
4 Dec 2020, 3:14 pmForum: Free Downloads WooCommerce -
Posted by meikatun
28 Nov 2020, 10:36 pmForum: Free Downloads WooCommerce -
Posted by systemz
8 Nov 2020, 5:14 pmForum: Free Downloads WooCommerce -
Posted by Charlie
27 Oct 2020, 7:51 amForum: Free Downloads WooCommerce
Most Fresh Topics
-
Posted by HAMZA ÖZAD
3 Jan 2021, 6:05 amForum: Free Downloads WooCommerce -
Posted by nerdontour
4 Dec 2020, 3:14 pmForum: Free Downloads WooCommerce -
Posted by meikatun
28 Nov 2020, 10:36 pmForum: Free Downloads WooCommerce -
Posted by systemz
8 Nov 2020, 5:14 pmForum: Free Downloads WooCommerce -
Posted by Charlie
27 Oct 2020, 7:51 amForum: Free Downloads WooCommerce
Most Popular Topics
-
Posted by zoecorkhill
18 Jan 2018, 6:14 pmForum: Free Downloads WooCommerce -
Posted by Richard Webster
21 Dec 2017, 12:36 pmForum: Free Downloads WooCommerce -
Posted by David Smith
24 Nov 2018, 8:57 pmForum: Free Downloads WooCommerce -
Posted by arneklein
20 Sep 2018, 2:16 pmForum: Free Downloads WooCommerce -
Posted by Charlie
27 Oct 2020, 7:51 amForum: Free Downloads WooCommerce
@hamzaozad
6:05 am