-
AuthorPosts
-
September 4, 2015 at 4:49 pm #498487
Hi Folks,
when I’m inserting a theme shortcode button with link target “new window”, the code is:
[av_button label='klick me klick me' link='page,469' link_target='_blank'...
and it will open a new tab or window.But when I change it to
[av_button label='klick me klick me' link='page,469' link_target='_top'...
after saving there’s no more target at all in the html/href.Is there a possibility not to filter out that “_top”? Because the page with the button is loaded in an iframe, and the button should link into the whole browser window – the reason, why “_top” has been invented…
Thanks a lot for an answer!
Best wishes
StephanSeptember 4, 2015 at 5:17 pm #498507Hey Stephan!
It only accepts the current window or a new window.
If you need to use _top then you can right click your page and view source and copy the button HTML and then paste it into a codeblock element and change the target that way.
Best regards,
ElliottSeptember 4, 2015 at 5:32 pm #498519Hi Elliot,
thanks for your fast answer. But unfortunatley the editors (exept me) don’t “speak” HTML. Isnt’ there any possibility for a filter in the functions.php? Or do you know the responsible file, which only accepts the “_blank”?
That would be a really great help!
Best regards,
StephanSeptember 7, 2015 at 8:11 am #499084Hey!
Please turn on the custom css class field. http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/
Modify the buttons that requires a target=”_top” attribute. In the custom css class field, add something like “custom-button”. Update the page. Add this in the functions.php file afterwards:
// target _top function add_custom_script(){ ?> <script> (function($) { $('.custom-button a').each(function() { $(this).removeAttr('target'); $(this).attr('target', '_top'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script');If you’re working on a shortcode, just add this parameter inside the button shortcode:
custom_class='custom-button'Regards,
IsmaelSeptember 7, 2015 at 6:57 pm #499486Great! Thousand Thanx – best support ever.
StephanSeptember 7, 2015 at 9:49 pm #499540Hey!
Glad you got it shorted out!
Best regards,
Basilis -
AuthorPosts
- The topic ‘theme shortcode button looses target "_top", but "_blank" works’ is closed to new replies.
