There is a wordpress template Parallax One in which I am interested in the blue download button on the first screen. when you click on it - go to the main page of the site using onclick .

 <button onclick="parent.location='http://themeisle.com/themes/parallax-one/'" data-anchor="" class="btn btn-primary standard-button inpage-scroll inpage_scroll_btn"> <span class="screen-reader-text">Header button label:Download Now</span> Download Now </button> 

I installed this template on my website, indicate in the settings the transition I need to the link /gallery - somewhere in the subject cant, does not go. Okay, I found in the code the section with the code I need, I write the same way in onclick in this way

 <?php $parallax_one_header_button_link = get_theme_mod('parallax_one_header_button_link','/gallery'); echo '<button id="inpage_scroll_btn" class="btn btn-primary standard-button inpage-scroll" onclick="'.$parallax_one_header_button_link.'"><span class="screen-reader-text">'.esc_html__('Header button label:', 'parallax-one').$parallax_one_header_button_text. '</span>'.$parallax_one_header_button_text.'</button>'; ?> 

with a variable or by specifying the full path onclick="parent.location='http://themeisle.com/themes/parallax-one/'" - but onclick does not work and does not go to the page, even though the editor displays the path correctly.

  • parallax_one_header_button_link is a setting in the template, look for a link and indicate - Blacknife
  • and if the setting is empty, then get_theme_mod will give out /gallery - that is, the default is Blacknife
  • @Blacknife is, in fact, yes - it gives me what I’m pointing out: onclick="parent.location='http://мой_сайт/gallery' problem is that nothing happens when the user clicks and it does not go anywhere .. - Vasya

1 answer 1

In general, I have a bad shielding of quotes on php , so I did it with html

 <button id="inpage_scroll_btn" class="btn btn-primary standard-button inpage-scroll" onclick="parent.location='<?php echo $parallax_one_header_button_link; ?>/'"><span class="screen-reader-text"> ('Header button label:','parallax-one')<?php echo $parallax_one_header_button_text; ?></span><?php echo $parallax_one_header_button_text; ?></button>