开发者

Wordpress custom URLs and templates

开发者 https://www.devze.com 2023-04-05 09:37 出处:网络
Easy question: how do I create a custom URL in WordPress without creating a page first? I know about template inheritance and I know that I can always specify a custom template in page-page_name.php.

Easy question: how do I create a custom URL in WordPress without creating a page first?

I know about template inheritance and I know that I can always specify a custom template in page-page_name.php. But instead of creating a page, I just want the custom template and the URL.

So if I go to http://mysite.com/custom_page_1 I want to be able to modify a template for this link and this link only without creating an empt开发者_运维问答y page called Custom Page 1.


Are you worried about publishing a page before it should be? Make a drat of that page and preview it.

If not, why cant you create the page?


To my knowledge, URLs are essentially permalinks that are generated by rewriting the default domain.com/?p=x, where x is the post ID. So unless there is something in the database that has an ID (post, page, category, user id, etc) then there is nothing to rewrite.

0

精彩评论

暂无评论...
验证码 换一张
取 消