查看: 6|回复: 0

[wordpress] wordpress侧边栏添加百度一下协助SEO优化

[复制链接]

24

主题

7

回帖

127

积分

青铜会员

Rank: 2

积分
127
威望
0
金币
41

论坛元老

鲜花(0) 鸡蛋(0)
发表于 7 天前 | 显示全部楼层 |阅读模式
网站的SEO非常重要,如果SEO做不好,那一个网站只有我们自己看了,别人都看不到,所以,我们可以在网站的侧边栏加一个百度一下协助[color=var(--focus-color)]SEO优化功能,让用户协助我们做好[color=var(--focus-color)]SEO优化

使用方法

1 : 添加小工具-自定义 HTML 代码首先在 [color=var(--focus-color)]wordpress 后台小工具中添加自定义 HTML代码
路径:WordPress 后台——外观——小工具——自定义 HTML——复制代码粘贴代码进去——首页-侧边栏
  1. <!--侧边栏开始-->
  2. <div class="searchs">
  3. <div class="tit"><strong>协助一下SEO.优化</strong></div>
  4. <mip-form method="get" url="https://www.baidu.com/s" class="mip-element mip-layout-container">
  5. <form action="https://www.baidu.com/s" method="GET" target="_blank">
  6. <input type="text" name="wd" validatetarget="q" validatetype="must" placeholder="请输入搜索关键词" value="狐狸资源网">
  7. <div target="q">关键词不能为空</div><input type="submit" value="百度搜索">
  8. </form>
  9. </mip-form>
  10. </div>
  11. <!--侧边栏百度一下结束 www.foxccs.com -->
复制代码





2:在自定义 CSS 样式中添加下面代码:
  1. /*百度一下协助SEO模块开始*/
  2. .searchs {
  3. background-color: #fff;
  4. border: 1px solid #eaeaea;
  5. padding: 15px;
  6. overflow: hidden;
  7. transition: all 0.3s;
  8. border-radius: 4px;
  9. position: relative;
  10. margin: 0px 0px 15px 0px;
  11. }
  12. .mip-layout-container, .mip-layout-fixed-height {
  13. margin: 0px 0px 0px 0px;
  14. display: block;
  15. position: relative;
  16. }
  17. mip-form form {
  18. position: relative;
  19. }
  20. .searchs input[type="text"] {
  21. border: #45B6F7 1px solid;
  22. border-radius: 4px;
  23. width: calc( 100% - 2px );
  24. }
  25. mip-form input[type='text'], mip-form input[type='input'], mip-form input[type='datetime'], mip-form input[type='email'], mip-form input[type='number'], mip-form input[type='tel'], mip-form input[type='url'] {
  26. padding-right: 30px;
  27. }
  28. .searchs input {
  29. outline: none;
  30. }
  31. mip-form input, mip-form textarea, mip-form select {
  32. border: 1px solid #f1f1f1;
  33. padding: 6px;
  34. display: block;
  35. box-sizing: border-box;
  36. -webkit-box-sizing: border-box;
  37. resize: none;
  38. font-size: 16px;
  39. }
  40. mip-form div {
  41. display: none;
  42. color: #ec1f5c;
  43. font-size: 12px;
  44. text-align: left;
  45. padding: 0 10% 0 3%;
  46. }
  47. .searchs input[type="submit"] {
  48. position: absolute;
  49. right: 2px;
  50. top: 2px;
  51. background-color: #45B6F7;
  52. color: #fff;
  53. font-size: 13px;
  54. margin: 1px;
  55. height: 31px;
  56. line-height: 31px;
  57. padding: 0 10px;
  58. font-family: "&#229;&#190;&#174;è&#189;&#175;é&#8250;…é&#187;‘";
  59. }
  60. mip-form input[type='submit'] {
  61. border: 1px solid #f1f1f1;
  62. border-radius: 5px;
  63. color: #333;
  64. background-color: #d8d7d7;
  65. }
  66. .searchs input {
  67. outline: none;
  68. }
  69. .tit {
  70. background-color: #FF5E52;
  71. position: relative;
  72. top: -15px;
  73. display: inline-block;
  74. color: #fff;
  75. padding: 4px 15px;
  76. font-size: 14px;
  77. }
  78. .tit strong {
  79. font-weight: normal;
  80. }
  81. .tit {
  82. background-color: #FF5E52;
  83. position: relative;
  84. top: -15px;
  85. display: inline-block;
  86. color: #fff;
  87. padding: 4px 15px;
  88. font-size: 14px;
  89. }
  90. /*百度一下协助SEO模块结束*/
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表