Special Offer: Buy All 48 Premium WordPress Themes for Just $74.99. Learn more

Open Clients Items in same browser tab

Clients Widget

Most of our themes come with built-in widgets which allows you to add clients. You can display them into your website using the ‘Clients’ widget.

By default, when click on them, these links are opened in a new browser tab. In some cases you may want to they to be opened in same browser tab.

It will require a small code change. Here are all of the necessary steps:

1. Install and Activate the WP Editor plugin: https://wordpress.org/plugins/wp-editor/

It is a very useful plugin which allows you to edit files inside all of the theme folders:

WP Editor Plugin

2. Navigate to Admin Panel -> Left Menu -> Appearance -> Theme Editor

3. Open yourtheme/inc/widgets/custom-posts-formats-widgets.php

4. Find and Replace the following code:

<a href=”<?php echo $data[‘link’]; ?>” title=”<?php the_title(); ?>” target=”_blank”>

with:

<a href=”<?php echo $data[‘link’]; ?>” title=”<?php the_title(); ?>”>

Just remove the target=”_blank” code.

5. Save Change

That’s all. Now the client items links will be opened into same browser tab when users clicks on clients thumbnail images.

About the Author

Tihomir Ivanov is a WordPress web developer, founder of tishonator.com, a fan of Linux and Open Source, a gym enthusiast, a vegan, a fan of minimalism, good movies and books :)

Leave a Reply