');background-size:100% auto;width:18px;height:6px;filter:alpha(opactiy=0);-ms-filter:"alpha(opacity=0)";-moz-opacity:0;-khtml-opacity:0;opacity:0;content:'';position:absolute;z-index:10}[data-balloon][data-balloon-pos=up]:before{bottom:100%;left:50%;margin-bottom:11px;-webkit-transform:translate3d(-50%,10px,0);-moz-transform:translate3d(-50%,10px,0);-ms-transform:translate3d(-50%,10px,0);transform:translate3d(-50%,10px,0);-webkit-transform-origin:top;-moz-transform-origin:top;-ms-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up]:after{bottom:100%;left:50%;margin-bottom:5px;-webkit-transform:translate3d(-50%,10px,0);-moz-transform:translate3d(-50%,10px,0);-ms-transform:translate3d(-50%,10px,0);transform:translate3d(-50%,10px,0);-webkit-transform-origin:top;-moz-transform-origin:top;-ms-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=left]:before{margin-right:11px;right:100%;top:50%;-webkit-transform:translate3d(10px,-50%,0);-moz-transform:translate3d(10px,-50%,0);-ms-transform:translate3d(10px,-50%,0);transform:translate3d(10px,-50%,0)}[data-balloon][data-balloon-pos=left]:after{background:no-repeat url('data:image/svg+xml;utf8,');background-size:100% auto;width:6px;height:18px;margin-right:5px;right:100%;top:50%;-webkit-transform:translate3d(10px,-50%,0);-moz-transform:translate3d(10px,-50%,0);-ms-transform:translate3d(10px,-50%,0);transform:translate3d(10px,-50%,0)}:root{--theme-color:#f1404b;--theme-color2:#ff49cd;--theme-muted-color:#555;--focus-color:var(--theme-color);--focus-shadow-color:rgba(249,100,90,.15);--key-color:#333;--main-color:#515255;--main-shadow:rgba(16,16,16,.4);--shadow-color:rgba(249,100,90,.6);--body-color:#555658;--body-bg-color:#f5f6f7;--main-bg-color:#fff;--transparent-bg-color:rgba(130,130,130,.1);--main-blur-bg-color:rgba(255,255,255,.85);--btn-blur-bg-color:rgba(61,62,64,.5);--btn-blur-color:#ddd;--muted-bg-color:#eee;--theme-bg-color:rgba(249,100,90,.1);--theme-border-radius:12px;--theme-border-radius-md:8px;--theme-border-radius-sm:6px}.ioc-dark-mode{--main-color:#c2c3c6;--theme-muted-color:#bbb;--body-color:#ccc;--body-bg-color:#202225;--main-bg-color:#292c2f;--main-blur-bg-color:rgba(41,44,47,.85);--btn-blur-bg-color:rgba(100,101,103,.5);--btn-blur-color:#888}body{margin:0;overflow-x:hidden;background:var(--body-bg-color);color:var(--body-color);font-family:"SF Pro SC","SF Pro Text","SF Pro Icons",PingFang SC,Lantinghei SC,Microsoft Yahei,Hiragino Sans GB,Microsoft Sans Serif,WenQuanYi Micro Hei,sans-serif!important}body a{color:var(--body-color)}a:link,a:visited{text-decoration:none!important}p{margin:0}.aligncenter{clear:both;display:block;margin-left:auto;margin-right:auto}.entry-content:after,.entry-content:before{content:"";display:table;table-layout:fixed}.entry-content:after{clear:both}.hentry{margin:0 0 1.5em}#emojis_link{padding:5px;line-height:30px;margin:0 0 0 -8px;max-width:246px;max-height:180px;height:auto;overflow:auto;background:#fff;border-radius:0 10px 10px;position:absolute;z-index:999;box-shadow:0px 20px 20px -5px rgba(39,45,68,.15)}#emojis_link img{width:30px;height:30px}.logo img{height:40px}.logo-light{display:inherit}.logo-dark{display:none}.text-hide{position:absolute;font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.border-radius-md{border-radius:var(--theme-border-radius-md)}.null-loading{background:linear-gradient(115deg,rgba(121,121,121,.1) 25%,rgba(121,121,121,.2) 37%,rgba(121,121,121,.1) 63%);-webkit-animation:placeholder-horizontal 1.5s ease infinite!important;animation:placeholder-horizontal 1.5s ease infinite!important;background-size:400% 100%!important}@-webkit-keyframes placeholder-horizontal{0%{background-position:100% 50%}100%{background-position:0 50%}}@keyframes placeholder-horizontal{0%{background-position:100% 50%}100%{background-position:0 50%}}.blur-btn{background:var(--btn-blur-bg-color)!important;-webkit-backdrop-filter:saturate(5) blur(10px);backdrop-filter:saturate(5) blur(10px)}.blur-fixed{background:rgba(0,0,0,.5)!important;-webkit-backdrop-filter:saturate(5) blur(15px);backdrop-filter:saturate(5) blur(15px)}.fixed-body{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000;opacity:0;visibility:hidden}header{z-index:1050}.header-normal{position:absolute;top:0;width:100%;margin:10px 0;padding:12px 0}.header-normal .social-group{display:none}@media screen and (min-width:992px){.header-normal{margin:38px 0}}.nav-type-normal{padding-top:84px}.main-navigation{display:none}.mobile-header .mobile-nav{position:fixed;display:block;bottom:0;left:0;top:0;width:82%;max-width:360px;padding:20px;z-index:1040;padding-top:90px;overflow:auto;background:var(--main-bg-color);transform:translateX(-400px)}.mobile-header .fixed-body{z-index:1030}.mobile-nav>.menu{padding:15px;background:var(--transparent-bg-color);border-radius:var(--theme-border-radius)}.social-icons{margin:0 8px;padding:4px;color:var(--theme-muted-color);font-size:20px}.offcanvas-menu-button{float:right;height:40px;width:40px;opacity:.8;z-index:98;font-size:24px;line-height:40px;text-align:center;border-radius:50%}@media screen and (min-width:992px){.header-normal .header-logo{margin-bottom:1rem}.header-normal .social-group{display:block}.main-navigation{display:block}.mobile-nav{display:none}.nav-type-normal{padding-top:200px}.offcanvas-menu-button{display:none}}.scrolling-hide{transform:translateX(0)}.social-group{position:relative}.social-group:before{content:"";position:absolute;width:1px;top:4px;bottom:4px;left:0;background:var(--theme-muted-color)}.nav-search{position:fixed;top:0;left:0;width:100vw;visibility:hidden;transform:translateY(-101%);height:auto;opacity:1;z-index:1080}.search-body{max-width:600px;margin:auto;padding:20px 0}.nav-search-close{display:inline-block;width:40px;height:40px;line-height:40px;margin-top:20px;text-align:center;background:var(--main-bg-color);border-radius:30px}.nav-search .search-body{padding:30px;background:var(--main-bg-color);border-radius:var(--theme-border-radius)}.search-box{position:relative}.search-field{color:var(--main-color);width:100%;padding:8px 20px;padding-right:36px;background:rgba(130,130,130,.15);border:none;border-radius:var(--theme-border-radius-md)}.search-field:-internal-autofill-previewed,.search-field:-internal-autofill-selected{box-shadow:0 0 0 1000px var(--body-bg-color) inset!important;-webkit-text-fill-color:var(--main-color)!important}.nav-search .search-field:-internal-autofill-previewed,.nav-search .search-field:-internal-autofill-selected{box-shadow:0 0 0 1000px var(--main-bg-color) inset!important;-webkit-text-fill-color:var(--main-color)!important}.search-submit{position:absolute;color:var(--main-color);background:0 0;border:none;margin:0;padding:5px;top:50%;right:3px;transform:translateY(-50%);z-index:1}.hot-post{max-height:168px;overflow-y:auto}.btn{color:var(--this-color);background:var(--this-bg);border:1px solid var(--this-border);box-shadow:var(--this-shadow);border-radius:var(--theme-border-radius-md);--this-color:var(--main-color);--this-bg:rgba(136,136,136,.1);--this-border:transparent;--this-shadow:none;--this-hover-color:var(--body-color);--this-hover-bg:rgba(136,136,136,.2)}.vc-theme{--this-color:#eee;--this-hover-color:#fff;--this-bg:var(--theme-color);--this-hover-bg:var(--theme-color2);--this-shadow-bg:var(--shadow-color)}.main-navigation{position:relative}.main-navigation ul{margin:0;padding-left:0;list-style:none}.main-navigation li{font-weight:400;text-transform:uppercase}.main-navigation li a{color:var(--body-color);padding:10px;display:block}.main-navigation .menu>li:first-child>a{margin-left:-10px;position:relative}.main-navigation ul li{position:relative;display:inline-block}.main-navigation ul li.menu-item-has-children{margin-right:5px}.main-navigation ul li.menu-item-has-children:after{content:'\e60d';font-family:"iconfont";position:absolute;top:14px;right:-2px;font-size:12px;-webkit-transform:scale(.6);transform:rotate(0deg) scale(.6)}.main-navigation ul li ul{position:absolute;min-width:160px;opacity:0;overflow:hidden;visibility:hidden;background:#fff;border-radius:12px;padding:4px;box-shadow:0 10px 30px 0px rgba(0,0,0,.3)}.main-navigation ul li ul li{width:100%;font-size:15.5px;font-weight:400;line-height:22px;text-transform:none;margin-bottom:2px}.main-navigation ul li ul li:last-child{margin-bottom:0;border-bottom:none}.sub-menu{z-index:999!important}.crumb-menu{margin-top:10px;font-size:13px;color:#999;white-space:nowrap;word-wrap:normal;text-overflow:ellipsis;overflow:hidden}.crumb-menu a,.crumb-menu a:visited{color:#999}.crumb-menu a:after{content:'22';display:inline-block;position:relative;margin:0 5px;color:var(--theme-color)}.mobile-header ul{margin:0;padding:0;list-style:none}.mobile-header ul li{font-size:16px;text-transform:uppercase}.mobile-header ul li:last-child{border:none}.mobile-header ul li.menu-item-has-children{position:relative}.mobile-header ul li.menu-item-has-children .mobile-dropdown-arrow{position:absolute;text-align:center;top:0;right:0;width:50px;line-height:50px;font-size:12px;color:#888}.mobile-header ul li.menu-item-has-children .mobile-dropdown-arrow:before{content:'';position:absolute;width:30px;height:30px;top:10px;left:10px;border-radius:30px;background:var(--transparent-bg-color)}.mobile-header ul li.menu-item-has-children .mobile-dropdown-arrow i{transform:rotate(0deg)}.mobile-header ul li.menu-item-has-children>a{padding-right:50px}.mobile-header ul li a{display:block;color:var(--body-color);line-height:50px}.mobile-header ul li ul{display:none}.mobile-header ul li ul li{font-size:16px;text-transform:none;border:none}.mobile-header ul li ul li a{padding-left:15px}.mobile-header .sub-menu li{width:calc(50% - 4px);text-align:center;display:inline-block}.mobile-header .sub-menu li>a{position:relative;line-height:normal;padding:6px 4px;margin:2px;font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:var(--transparent-bg-color);border-radius:var(--theme-border-radius-sm)}.single-header-image-block{background:rgba(0,0,0,.5);background-size:cover;background-position:center;filter:blur(15px);-webkit-filter:blur(15px);-ms-filter:blur(15px);-moz-filter:blur(15px);filter:progid:DXImageTransform.Microsoft.blur(pixelRadius=15,MakeShadow=false);-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.single-thumbnail,.single-header-image-block{height:400px;width:100%}.container .single-thumbnail,.container .single-header-image-block{height:350px}.single-thumbnail{overflow:hidden;filter:brightness(50%);box-shadow:0 22px 50px -24px rgba(0,0,0,.6);background-color:#fff}.single-thumbnail-card{position:relative}.single-thumbnail{height:400px;width:100%}.container .single-thumbnail{height:350px}.single-thumbnail{overflow:hidden;filter:brightness(50%);box-shadow:0 22px 50px -24px rgba(0,0,0,.6);background-color:#fff}.container .single-thumbnail{border-radius:var(--theme-border-radius)}.single-thumbnail-card .card-img-overlay{top:auto;padding-bottom:20px}.single-title-zone h1{margin-top:6px;margin-bottom:13px;color:#fff;font-size:28px;font-weight:700;letter-spacing:-.3px;line-height:37px}.single-title-zone .date{color:#fff;opacity:.7}.post .entry-content{margin:1.5em 0 0}.post .entry-content p{margin:0 0 20px;line-height:28px}.post .entry-content p a:not(.btn){position:relative;color:var(--theme-color);border-bottom:.0625rem dashed rgba(155,155,155,.2)}.post .entry-content p a:not(.btn):not([data-fancybox]):after{position:absolute;bottom:-.0625rem;left:100%;width:0;border-bottom:.0625rem solid var(--theme-color);content:""}.post .entry-content img{max-width:100%;height:auto;margin-top:10px;margin-bottom:30px}.entry-content img{background:url(/wp-content/themes/ioswallow/images/img.svg) no-repeat center #e6e6e6}.post .entry-content h3{margin:0 auto 18px auto;padding-top:20px}.post .entry-content h3{font-size:1.35rem}.aligncenter{display:block;margin:5px auto 5px auto}a#cancel-comment-reply-link{color:#fff;background-color:rgba(150,150,150,.5);border-color:rgba(150,150,150,.5);border-radius:.22rem;white-space:normal;padding:10px 15px;font-size:17px;margin-right:10px}#loading-comments{display:none;width:100%;height:45px;background:url(/wp-content/themes/ioswallow/images/comload.gif);text-align:center;background-repeat:no-repeat;background-position:center}.comment-form-validate input[type=checkbox]{visibility:hidden;display:none}.footer-tools{position:fixed;bottom:40px;right:10px;z-index:1040;text-align:center;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.footer-tools a{border:0;font-family:inherit;font-size:100%;font-style:inherit;margin:0;padding:0;vertical-align:baseline}.footer-tools a{background:rgba(55,55,55,.8);font-size:20px;color:var(--btn-blur-color);width:40px;height:40px;line-height:40px;text-align:center;margin-top:6px;display:block;border-radius:25px}.footer-tools .tools-btn{display:none}.buttontop-top{overflow:hidden;visibility:hidden;opacity:0;white-space:nowrap}.button-fx:before,.button-fx:after{position:absolute;content:'';display:block;width:140%;height:100%;left:-20%;z-index:-1000;background-repeat:no-repeat}.button-fx:before{display:none;top:-75%;background-image:radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,transparent 20%,var(--theme-color) 20%,transparent 30%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,transparent 10%,var(--theme-color) 15%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%);background-size:10% 10%,20% 20%,15% 15%,20% 20%,18% 18%,10% 10%,15% 15%,10% 10%,18% 18%}.button-fx:after{display:none;bottom:-75%;background-image:radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,transparent 10%,var(--theme-color) 15%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%),radial-gradient(circle,var(--theme-color) 20%,transparent 20%);background-size:15% 15%,20% 20%,18% 18%,20% 20%,15% 15%,10% 10%,20% 20%}#whisper{position:fixed;bottom:42px;right:65px;min-width:200px;min-height:40px;max-width:500px;margin-left:50px;z-index:10;border-radius:15px;background:var(--theme-color);background:-webkit-gradient(linear,left top,right top,from(var(--theme-color)),to(var(--theme-color2)));background:-webkit-linear-gradient(left,var(--theme-color),var(--theme-color2));background:linear-gradient(90deg,var(--theme-color),var(--theme-color2));-webkit-box-shadow:0 15px 20px rgba(31,45,61,.2);box-shadow:0 15px 20px rgba(31,45,61,.2);-webkit-transform-origin:calc(100% + 10px) calc(100% - 18px);transform-origin:calc(100% + 10px) calc(100% - 18px)}#whisper .shuo_time{position:absolute;color:#fff;font-size:12px;left:0;top:-22px;border-radius:10px;padding:0 10px;background:var(--theme-color2)}#whisper .shuo_more{position:absolute!important;left:-45px;top:0;width:40px}#whisper .shuo_more a{display:block;color:#fff!important;text-align:center;line-height:40px;font-size:20px;width:40px;height:40px;border-radius:50%;background:var(--theme-color)}#whisper .shuo_time:after{content:"";position:absolute;right:-15px;top:4px;height:10px;width:10px;border-radius:50%;background:var(--theme-color)}#whisper .whisper_details{color:#fff}#chatTemplate{color:#fff;max-height:400px;overflow:auto;-webkit-overflow-scrolling:touch;padding:8px 15px}#whisper.unavailable{visibility:hidden;-webkit-transform:scale(0);transform:scale(0);opacity:0}#whisper:after{content:"";position:absolute;right:-8px;bottom:5px;border-top:15px solid transparent;border-bottom:15px solid transparent;border-left:12px solid var(--theme-color2)}#whisper .shuo_more .circle{width:100%;height:100%;position:absolute;z-index:-1;border-radius:50%;opacity:0;background:var(--theme-color);animation:circle-opacity 2s infinite}@keyframes circle-opacity{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}@media screen and (max-width:991.98px){.single-title-zone h1{font-size:22px;line-height:30px}.footer-tools .tools-btn{display:block}}@media screen and (max-width:575.98px){.post .entry-content img{max-width:100%}.container .single-thumbnail-card .card-img-overlay{padding:0 20px 20px}.single-title-zone h1{margin-top:5px;margin-bottom:10px;letter-spacing:0}.single-title-zone .category{font-size:16px}.single-thumbnail{height:300px}.entry-content{word-wrap:break-word}.post .entry-content img{margin-top:23px;margin-bottom:43px}}.wechat{position:relative}.wechatimg{position:absolute;z-index:999;visibility:hidden;width:121px;height:121px;padding:10px;background:#383a3f;border-radius:var(--theme-border-radius);-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0);opacity:0}.wechatimg.menu{top:30px;left:-45px}.wechatimg img{max-width:100%;height:auto;vertical-align:middle;border-radius:var(--theme-border-radius-md)}.wechatimg:before{content:"";position:absolute;display:block;border-style:solid}.wechatimg.menu:before{border-width:0 10px 10px;border-color:transparent transparent #383a3f;top:-10px;margin-left:-10px;left:50%}@media (max-width:767.98px){#whisper{bottom:38px;right:55px}}.post-social{position:absolute;height:100%;opacity:1;margin-left:-60px;left:0;width:40px}.post-social li{position:relative;text-align:center;display:block;font-size:1.25rem}.post-social li a{display:block;line-height:40px}@media (min-width:768px) and (max-width:991.98px){.post-social{margin-left:-45px}}.btn.weibo{color:#e24040!important}.btn-primary{background-color:var(--theme-color)!important;border-color:var(--theme-color)!important;box-shadow:0px 5px 20px -3px var(--shadow-color)!important}.theiaStickySidebar .count{position:absolute;left:24px;top:5px;padding:0 5px;height:16px;border-radius:8px;background-color:var(--theme-color);font-size:12px;line-height:16px;text-align:center;color:#fff;font-weight:600}.py-1 .btn-light{background-color:#fff;border:unset}.w-40{width:40px!important;height:40px!important}.small-menu{position:absolute;height:100%;opacity:1;margin-right:-230px;margin-top:0;right:0;width:200px}.small-menu .small-menu-body{display:none;border:none;font-size:14px;line-height:18px;text-align:left}.small-menu #small-menu-ul{list-style:none;margin-left:1px;padding:8px 0 16px;border-left:1px solid rgba(202,209,219,.404);position:relative}.small-menu .small-title{font-size:16px;margin-left:-7.5px}.small-menu .small-title>i{margin-right:14px}#small-menu-ul:after{content:"";position:absolute;width:9px;height:9px;background:#838383;left:-5px;bottom:0;border-radius:50%}.text-xs{font-size:.75rem!important}.text-sm{font-size:.875rem!important}@media (max-width:767.98px){.text-sm{font-size:.825rem!important}}@media screen and (max-width:575.98px){.container{width:100%}}.card-img-overlay{border-radius:12px}.btn-light{background-color:#fff;border-color:#fff}.ioc-dark-mode .text-muted{color:#888!important}.ioc-dark-mode .btn-light{color:#bcbcbc;background-color:#454545;border-color:#454545}.ioc-dark-mode .logo-light{display:none}.ioc-dark-mode .logo-dark{display:inherit}.ioc-dark-mode .main-navigation ul li ul{background:#383a3f;box-shadow:none}.ioc-dark-mode #emojis_link{background-color:#383a3f}.ioc-dark-mode .entry-content img{background-color:#555}.wow{visibility:hidden}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.fadeInLeft{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}@-webkit-keyframes fadeInRight{0%{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInRight{0%{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.fadeInRight{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,20%,0);transform:translate3d(0,20%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,20%,0);transform:translate3d(0,20%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}:root{--swiper-theme-color:#007aff}:root{--swiper-navigation-size:44px}.container.custom-width{max-width:950px}
WordPress 最佳固定链接设置 - 赢聚网 WordPress 最佳固定链接设置
5年前
1.1K
新手在使用 WordPress 搭建好一个网站后,会涉及到一个 WordPress 固定链接,又叫做 WordPress 伪静态的设置。
WordPress 固定链接分为朴素、日期和名称型、 月份和名称型、数字型、文章名和自定义结构,那么使用哪种固定方式才是 WordPress 最佳固定链接设置呢?
WordPress 最佳固定链接设置选项
WordPress 最佳固定连接可以选择数字型和文章名两种,如果你是最求细节的人,愿意每篇文章都修改文章名,那么推荐选择文章名,不然的话就直接选择数字型吧。
另外,如果你是一个喜欢更个性的固定链接方式的人,也可以选择自定义格式。
就像下图这样:
例如选择自定义结构,然后尾部加上 .html (如果你需要安装开源版的 WordPress 小程序,那么你需要加上 .HTML 才能做到小程序文章内的链接跳转功能)那么本文的网址就会变成:
https://www.winrss.com/分类名/文章名.html
你现在看到的 赢聚网 的固定链接格式选择的就是数字型,例如这篇“WordPress 最佳固定链接设置,选择哪种伪静态规则比较好”的链接是:
https://www.winrss.com/tutorial/wordpress-permalink.html
注意:选择文章名的形式对 SEO 有好处,不过需要你为每篇文章设置一个文章名,这个文章名最好是修改为英文或者拼音形式的,如果不做修改,那么网址就会直接变成你网址 + 中文标题的形式,很长而且很难看。
当然,你可以自由组合,可用标签有下面这些,分别对应的意思如下:
%year%
年
%monthnum%
月
%day%
日
%hour%
时
%minute%
分
%second%
秒
%post_id%
文章 ID(自动生成的)
%postname%
文章名(需要自己修改,不修改就使用文章标题)
%category%
分类名
%author%
作者
后面的.html
你可以自己随便写,例如写成.love
这些任何你想的都可以的。
WordPress 固定链接后 404
当你设置完毕 WordPress 固定链接设置后,访问网站首页没有问题,但是访问文章页面会报 404 错误打不开的话,就是因为你服务器的伪静态规则没有设置好。
伪静态规则设置
目前赢聚网推荐常用的环境是宝塔面板或者 Oneinstack 一键包这些,对应的固定链接伪静态规则如下:
宝塔面板伪静态规则设置
宝塔面板的话,进入宝塔面板后台,然后在你网站的设置里面,选择伪静态,然后选择 wordperss 保存即可。
Oneinstack 一键包伪静态设置规则
Oneinstack 一键包的话,设置伪静态规则可以在添加虚拟主机的时候就设置好,具体位置在添加虚拟主机的时候,询问是否使用伪静态,输入 y,然后输入 WordPress 即可。
如果你是已经添加好了网站,发现忘记添加伪静态规则了,有两种方法解决:
~/oneinstack/vhost.sh --del
删除添加的虚拟主机配置文件,然后~/oneinstack/vhost.sh
重新添加。- 配置虚拟主机的
.conf
文件,把伪静态规则加进去:
include /usr/local/nginx/conf/rewrite/wordpress.conf;
自己编译的 Nginx 配置伪静态
如果你不是使用的一键包或者宝塔安装的网站环境,而是自己编译的 nginx ,那么自己在虚拟主机配置信息里面加上下面这段内容,然后重启 nginx 就可以了。
location /
{
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
Nginx 二级目录伪静态规则
把下面的 blog 改成你二级目录的名字添加到虚拟主机配置文件里面即可。
location /blog/ {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /blog/index.php;
}
}
rewrite /blog/wp-admin$ $scheme://$host$uri/ permanent;
Apache WordPress 伪静态规则
在网站根目录的 .htaccess
文件里面插入下面的代码即可在 Apache 下开启 WordPress 伪静态规则。
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>
注意事项
特别要提醒的是,从网站 SEO 的长远考虑,一开始就确定好固定链接设置哪一种,当网站正式上线运营后,不要轻易修改固定链接的形式,不然可能会造成网站排名消失等 SEO 不利因素。
上一篇别做梦 外贸网站做 Google SEO 不是给钱就能成的
下一篇WordPress 一个功能设置让网站文章秒收录