Home › Forums › WoodMart support forum › Banner links not working
Banner links not working
- This topic has 17 replies, 3 voices, and was last updated 4 years, 4 months ago by Artem Temos.
-
AuthorPosts
-
February 26, 2020 at 2:10 pm #176338
ex501ParticipantBanner links are not working on my website. Actually few of them stopped working on main page.
Please check private content:February 26, 2020 at 2:36 pm #176357
Artem TemosKeymasterHello,
Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?
Thank you in advance
February 26, 2020 at 3:26 pm #176366
ex501ParticipantOk but I doubt it’s plugin because one of the banners is working and banners on other pages are working as well.
Check private content:
February 26, 2020 at 8:29 pm #176368
Artem TemosKeymasterWe were not able to login with this data and can’t retry now https://gyazo.com/484d88a5add7874a7df8e08e25f88e8f
February 26, 2020 at 8:56 pm #176439
ex501ParticipantCheck private
February 27, 2020 at 7:05 am #176489
Artem TemosKeymasterCould you please send us your FTP access as well? And switch to the parent theme too.
February 27, 2020 at 7:45 am #176502
ex501ParticipantCredentials are below
February 27, 2020 at 8:00 am #176506
Artem TemosKeymasterPlease, disable all external plugins and the child theme. And your FTP access is empty. If you can’t do this, you need to create a staging development copy of your website. There, you will be able to do such kind of experiments without any harm to your production website.
Kind Regards
February 27, 2020 at 8:08 am #176509
ex501ParticipantPlease try again.
It seems that WPML is screwing up banners links …February 27, 2020 at 9:11 am #176523
Artem TemosKeymasterStrange but it seems that WPML somehow modifies the link and breaks it. Try to contact WPML devs to investigate this issue. As for workaround, you can edit this file
wp-content/themes/woodmart/inc/shortcodes/promo-banner.php
and replace the code from$onclick = 'window.location.href=\''. esc_url( $attributes['url'] ).'\'';
to
$onclick = 'window.location.href=\''. $attributes['url'] .'\'';
as shown on the screenshot http://prntscr.com/r8d9fp
February 27, 2020 at 10:26 am #176546
ex501Participantyour alternative didn’t work :/
February 27, 2020 at 12:01 pm #176599
Artem TemosKeymasterPlease, send us a screenshot where you have changed the code so we can check it.
February 27, 2020 at 1:18 pm #176637
ex501ParticipantHere is screen of modified code: https://c2n.me/46cDWGe
Problem is still there. WPML says that I shall contact theme authors and you say that I shall contact WPML….
February 27, 2020 at 1:30 pm #176639
Artem TemosKeymasterBut what exactly should we fix from our theme side? It is just a regular link and WPML seems to break it somehow. It is not something that our theme breaks in WPML but the WPML breaks in the theme. If there are some requirements from their side then we will be glad to help you to implement this.
As a workaround, try to replace this code
<div id="<?php echo esc_attr( $id ); ?>" class="promo-banner<?php echo esc_attr( $class ); ?>" <?php if( $link && $attributes['url'] ) echo 'onclick="' . $onclick . '"'; ?> >
with this on
<div id="<?php echo esc_attr( $id ); ?>" class="promo-banner<?php echo esc_attr( $class ); ?>" data-click="<?php echo esc_url( $attributes['url'] ); ?>">
and put the following code to the Custom JS field in Theme Settings
jQuery('.promo-banner').on('click', function(){ if (jQuery(this).data('click')) { window.location.href=jQuery(this).data('click'); } });
February 27, 2020 at 1:57 pm #176653
ex501ParticipantYour patch works. Thank you! I assume I will have to do this every time when I update theme.
I will bother WPML support to fix this issue, I am sure other woodmart users may have a problem.February 27, 2020 at 1:58 pm #176654
Artem TemosKeymasterFine, contact us if you will have any further information about the issue.
September 2, 2020 at 11:28 am #223034
incomazParticipantIn the latest version of Woodmart, I have observed that the LINK does not work on the promotional banner.
To solve it I have modified the file
wp-content/themes/woodmart/inc/shortcodes/promo-banner.php
.I have replaced:
if ( strrpos( $link, '|') ){ $attributes = woodmart_vc_get_link_attr( $link ); }else{ $attributes = array( 'target' => '', 'url' => $link, ); }
by:
$attributes = woodmart_vc_get_link_attr( $link );
September 2, 2020 at 11:46 am #223042
Artem TemosKeymasterIt is working correctly for us without any fixes now. If you have any problems, please, create a separate topic and provide us your website access so we can check.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register