Suggestion – Add Support For print on AMP
-
Hello, the print button on AMP is broken, I use the following workaround:
$a2a_output = ADDTOANY_SHARE_SAVE_KIT( array( 'buttons' => array( 'twitter', 'reddit', 'pinterest', 'whatsapp', 'facebook', 'email', 'print' ), 'output_later' => true) ); $a2a_output = preg_replace('/<a class="a2a_button_print".*?>/mi', '<a class="a2a_button_print" on="tap:AMP.print()" href="#" title="Print" rel="nofollow noopener">', $a2a_output); echo str_replace('style="background-color:#0166ff"', 'style="background-color:#434343"', $a2a_output);
It would be nice if I wouldn’t have to do a regex on the output.
Also for the share icon(the plus sign), there isn’t a way to customize the color on AMP other than replacing the hardcodedstyle="background-color:#434343
with astr_replace
before output.For the other icons, you can use a filter like this one:
add_filter('A2A_SHARE_SAVE_services', function ($A2A_SHARE_SAVE_services) { foreach(array_keys($A2A_SHARE_SAVE_services) as $key){ $A2A_SHARE_SAVE_services[$key]['color'] = '434343'; } return($A2A_SHARE_SAVE_services); });
but not for the share icon which seems to be hardcoded to
style="background-color:#0166ff"
.I didn’t try to submit a PR on GitHub because it seems the repo is out of date.
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Suggestion – Add Support For print on AMP’ is closed to new replies.