Hello @peaktoplate,
I don’t think the simple social icons plugin has a setting or filter to change the target attribute value.
You could use a bit of JavaScript to modify the link target and set it to open in the same window.
Here is an example:
function modify_simple_social_icons_link_target() {
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
var socialIcons = document.querySelectorAll('.simple-social-icons ul li a');
socialIcons.forEach(function(icon) {
// Set the target attribute to '_self' to open links in the same window
icon.target = '_self';
});
});
</script>
<?php
}
add_action('wp_footer', 'modify_simple_social_icons_link_target');
@peaktoplate, actually now that I looked at the plugin there is a checkbox on the widget that says “Open links in new window?”. Uncheck that and your links should open in the same window.
https://capture.dropbox.com/j37Unj6BnqnThWHc
Thread Starter
Annie
(@peaktoplate)
@stevejonesdev thanks for looking into it! I do have the “open in new window” box unchecked, but the default is still set to open in a new tab so the new window icon still shows up. Would I add the code you mentioned in the additional CSS section?
Thanks!
Annie
Thread Starter
Annie
(@peaktoplate)
@stevejonesdev nevermind. I added the code to the plugin and it fixed my issue. Thank you so much for your help!
Annie