wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

[Solved] open in the same window


cihan
Posts: 26
Topic starter
(@cihan)
Eminent Member
Joined: 1 year ago

Hello

When I click on the username and profile picture it opens in a new window. There were codes that prevented this, it doesn't work anymore. 🙁

How can I get it to open in the same window?

4 Replies
Asti
Posts: 4613
 Asti
Support
(@asti)
Support member
Joined: 4 years ago

Hi @cihan,

Use the following hook code:

add_filter("wpdiscuz_author_link_attributes", function ($attrs) {
    $attrs["target"] = "_self";
    return $attrs;
});

Put the code in the WordPress active theme functions.php file.

This article should be helpful for you:  https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

Please delete all kinds of caches and check again. 

wpDiscuz also has a built-in caches system Please delete this cache as well. It's located in the Dashboard > wpDiscuz > Settings > General Settings tab. 

image
cihan
Posts: 26
Topic starter
(@cihan)
Eminent Member
Joined: 1 year ago

Hello thank you very much.

But not working:(

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 4613

@cihan,

Please record a video where we can see that you've added the codes and deleted the caches. Also, leave an example URL where we can check the issue.

cihan
Posts: 26
Topic starter
(@cihan)
Eminent Member
Joined: 1 year ago

thank you asti, working. 

and i found this code this is for profile picture;

add_filter('wpdiscuz_avatar_link_attributes', function ($attr) {
if (isset($attr['target'])) {
$attr['target'] = '';
}
return $attr;
});

 

Share: