您可以编辑页眉和页脚文件,也可以在函数中插入这些代码。php文件
function add_google_code($url="",$utm_code="",$utm_campaign=""){ ?>
<a href=\'<?php echo $url ?>?utm_source=<?php echo $utm_code ?>&utm_campaign=<?php echo $utm_campaign ?>&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1\'><img alt=\'Get it on Google Play\' src=\'https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.eps\'/></a>
add_action(\'wp_head\',\'add_google_code\',\'#url\',\'#utm_code\',\'#utm_campaign\');
add_action(\'wp_footer\',\'add_google_code\',\'#url\',\'#utm_code\',\'#utm_campaign\');
现在保存并刷新主站点,您可以看到您的徽章。您需要更换
#url with your app url
#utm_code utm code with the utm code ...