Shortcode Links in New Window

Beautiful and responsive WordPress theme with amazing parallax effect.
GK User
Thu Nov 17, 2016 4:09 am
I would like the links in the "Our Clients" text widget to open in a new window.
The widget used the [client] short code with items with the items looking like this:
(http://www.example.com) [pageurl]/wp-content/uploads/logo.png
Adding target="_blank" within the brackets didn't work, is it possible to do this? If I have to change something in the .php files is it possible to do so in the child theme so I do not lose this change when I update my theme?
User avatar
Fresh Boarder

Joshua M
Thu Nov 17, 2016 9:03 am
Hello,

Sure, you can use a child theme, you have to edit gavern/helpers/helpers.shortcodes.php file and change the line (836):
Code: Select all
$output .= '<a href="'.$link.'"><img src="'.$logo.'" alt="" /></a>' . "\n";

into:
Code: Select all
$output .= '<a target="_blank" href="'.$link.'"><img src="'.$logo.'" alt="" /></a>' . "\n";
User avatar
Moderator

GK User
Fri Nov 18, 2016 3:53 am
Thanks, I found the line of code but I am having issues getting it to work in my child theme.
I tried both placing the file in the Creative-Child directory as well as the same path in the parent theme.
Then I tried both
include TEMPLATEPATH . 'helpers.shortcodes.php'
and
include TEMPLATEPATH . '/gavern/helpers/helpers.shortcodes.php;
in both cases I got an "Access Denied" error. Any suggestions?
User avatar
Fresh Boarder

Joshua M
Fri Nov 18, 2016 8:50 am
Hi,

You should use the same path as the parent theme and it should works. You can send me a PM with backend and FTP access, then I'll be able to check the issue, but generally the Creative theme is not supported anymore (we are supporting only latest 24 themes), so there won't be future updates (expect security updates).
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.