简体   繁体   中英

wordpress - Rewrite post permalink

I've a custom post type that it can view on mywebsite.com/custom_post_type/ (with archive.php), but I don't understand how change permalink of "post" (default type - articles). This is what I need: I want to read all "post" with this url: mywebsite.com/news/. "News" would the slug for "post" type.

I think it's necessary to rewrite the permalink, but I didn't found anything on google.

Can you help me? Thanks

I'm not 100% sure I understand your questions but I think you are trying to do is view all 'Posts' under mywebsite.com/news/ - In that case simply create a page called News (with the slug/permalink as news) and then in Settings > Reading - set the Front page to 'A static page', with the front page selecting your 'Home' page and the Posts page set as 'News' (the page you just made).

If you are talking about viewing all posts of a custom post type under news, either name the post type slug (under your rewrite array setting when you register the CPT) as News.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM