- This topic has 2 replies, 2 voices, and was last updated 3 years, 10 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support › Forums › Flex Theme › Banner Button Link Open in New Tab
On the home page, the banner section with the image and 2 buttons, I can’t find where I can make these links open up in a new tab. I’ve looked all over in the php files as well. I need to have these links open in a new tab.
Thanks!
– Mike
I found the home-banner.php file, but not sure where to add the target=”_blank” in the code line. I imagine its’ somewhere in line 169-170 since I want to change the first button. Can anyone here direct me to where I should add it?
Open the home-banner.php file from lib/widgets
Replace
if( $instance['button_1'] && $instance['button_1_url'] ) {
printf( '<a class="button btn-1 solid" href="%1$s">%2$s</a>', $instance['button_1_url'], $instance['button_1'] );
}
if( $instance['button_2'] && $instance['button_2_url'] ) {
printf( '<a class="button btn-2 blank" href="%1$s">%2$s</a>', $instance['button_2_url'], $instance['button_2'] );
}
WITH
if( $instance['button_1'] && $instance['button_1_url'] ) {
printf( '<a class="button btn-1 solid" href="%1$s" target="_blank">%2$s</a>', $instance['button_1_url'], $instance['button_1'] );
}
if( $instance['button_2'] && $instance['button_2_url'] ) {
printf( '<a class="button btn-2 blank" href="%1$s" target="_blank">%2$s</a>', $instance['button_2_url'], $instance['button_2'] );
}