代码一
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>预设下载页面</title> </head> <body> <button onclick="download()" style="margin:0 auto">Pr预设下载</button> <script> function download(){ window.location.href="下载链接"; } </script> </body> </html> ~
代码二
<div id="download"> <a style="border-radius: 5px; color: #fff; background-color: #32a5e7; border: 2px solid #32a5e7; text-indent: 0; padding: 8px 25px 9px;"href="下载链接"> 按钮样式 </a> </div>
以上就是纯代码实现WordPress页面/文章添加下载按钮的全部内容,如果你偶尔使用一些自定义按钮,这上面的代码可能是你的选择。