Link opening in a new tab
-
How do I prevent the service box links from opening in a new tab?
-
Which design template of service box you have using?
Thanks
Design 1
Follow my instruction here
Step-1 : Open your plugin directory and then open service-box plugin folder.
Step-2 : Now follow this path template -> designs – > design-1 , In design-1 folder you will see a file is index.php
Step-3 : Open index.php on any editor and then go to near line no. 111
Step-4: Find below code there –
” class=”wpsm_read”><?php echo $sb_web_link_label; ?>
Step-5 : replace above given code with this code –
” class=”wpsm_read”><?php echo $sb_web_link_label; ?>
Check screenshot for help –
Step-6: Save your code.
Try this procedure and then let me know.
Thanks
- This reply was modified 7 years, 9 months ago by wpshopmart.
It changed the colour of the font for the read more link, but still opened in a new tab.
Can you please share me your service page url?
Thanks
You will need Follow thee steps to open link on same tab –
Step-1 : Open your plugin directory and then open service-box plugin folder.
Step-2 : Now follow this path template -> designs – > design-1 , In design-1 folder you will see a file is index.php
Step-3 : Open index.php on any editor and then go to near line no. 111
Step-4 : Find below code there –
<a target="_blank" href="<?php echo $service_link; ?>" class="wpsm_read"><?php echo $sb_web_link_label; ?> </a>
Step-5 : replace above given code with this code –
<a href="<?php echo $service_link; ?>" class="wpsm_read"><?php echo $sb_web_link_label; ?> </a>
Check screenshot for help.
Step-6 : Save your code.
Try this procedure and then let me know.
Thanks
That doesn’t seem to have worked either.
Hi,
Can you please contact me at wpshopmart[at]gmail[dot]com
Thanks
Hi did you figure it out? I have the same issue.
It worked for me i just changed the blank to self in the line wpshopmart (@wpshopmart)
said to, thank you wpshopmart.Sorry, I can’t find the plugin directory folder. I only get the editor. Please help.
thanksOk junglemman,
Follo me here to update plugin code via editor –
Step-1 : First install & activate this plugin wp-editor and then go to plugin menu then open plugin editor submenu.
Step-2 : Now select service box plugin for edit (See Screenshot)
Step-3 : Now follow this path template -> designs – > design-1 In design-1 folder you will see a file is index.php ( See screenshot)
Step-4 : G o to near line no. 111 and then Find below code there –
<a target="_blank" href="<?php echo $service_link; ?>" class="wpsm_read"><?php echo $sb_web_link_label; ?> </a>
Step-5 : replace above given code with this code –
<a href="<?php echo $service_link; ?>" class="wpsm_read"><?php echo $sb_web_link_label; ?> </a>
Step-6 : Save your code and thecn your service box.
Thanks
Actually that is wrong u just need to change the blank to self in the first code line 111.
- This reply was modified 7 years, 8 months ago by mostafa0401.
- This reply was modified 7 years, 8 months ago by mostafa0401.
- This reply was modified 7 years, 8 months ago by mostafa0401.
- This reply was modified 7 years, 8 months ago by mostafa0401.
I have just come across this exact issue and wanted to share my work around that I feel is a bit more WPCodex worthy. Doing it this way is less intrusive and will not break once the plugin is updated in the future.
Step-1 : First create a remove-blank.js file and place it in your current_child_theme/js/ folder like so…
( function ( document, $, undefined ) { $(document).ready(function(){ $(".wpsm_read_more").attr("target", ""); }); })( document, jQuery );
Step-2 : Properly enqueue that file in your child theme’s functions.php file like so…
function my_enque_scripts() { wp_enqueue_script( 'remove_blank', get_stylesheet_directory_uri() . '/js/remove-blank.js', array('jquery') ); } add_action('wp_enqueue_scripts', 'my_enque_scripts');
- The topic ‘Link opening in a new tab’ is closed to new replies.