Home › Forums › Jevelin Theme › URL under Icon Box – open in new tab
Home › Forums › Jevelin Theme › URL under Icon Box – open in new tab
Hi Team,
I’m wondering if there is an option to add URL under Icon Box that will open content in new tab in browser?
Standard <a target=”_blank” href=” actually is now working.
Thanks,
Marcin
Solution for this topic
Hi Marcin,
I hope you are well today and thank you for your question.
You can achieve this by adding following custom code in the functions.php file of your child theme.
function add_custom_scripts_icon_box(){ ?> <script type="text/javascript"> jQuery(document).ready(function( $ ){ $( '.sh-iconbox-title a' ).attr( 'target', '_blank' ); }); </script> <?php } add_action('wp_footer', 'add_custom_scripts_icon_box', 99 );
Best regards,
Shufflehound team
Hi Team,
One question for this solution. I will get an option to choose whether to paste link that will open in same window and another option to open link in new tab?
I have few icon boxes that I still want url’s to open in same window.
Thanks,
Marcin
If that will give me an option to open links (in same tab or open in new) would it be possible if you could mark a place where exactly I should place mentioned code in functions.php file? [attaching this file]
Many thanks!
in zip file
One question for this solution. I will get an option to choose whether to paste link that will open in same window and another option to open link in new tab?
No it won’t prove any such option.
You can add the code in the end of shared functions.php file just after following code.
add_filter( 'facetwp_template_force_load', '__return_true' );
Thanks for your help.
You are most welcome here 🙂