简体   繁体   中英

Custom WordPress permalink structure

Is it possible to have the following structure, and if so, how:

  • www.example.com/ something (A custom archive page with posts from a certain post category ['poca'] and a certain custom post type ['cuty'])
  • www.example.com/ something /beautiful (A post of category ['poca'])
  • www.example.com/ something /ugly (A post of my custom post type ['cuty'])

I can achieve to get my custom archive page to work. Moreover everything works so that 'poca' and 'cuty' takes the same template. But coming from something to one of these posts, it takes the normal permalink (category-name or custom-post-type) instead of something

Is there a way to achieve that it takes my custom archive page into the url instead?

By the way: I am able to achieve the result by using a custom shortcode for my custom post type and then creating a new post with that shortcode in the wanted category, but this brings a consistency problem, as there's always the need to create two posts for the one thing I'd like to have.

So I finally found a solution. Seems not the best way but it's ok for me to do it this way...

Through using the plugin "Custom Permalinks" I can add the permalink I want, so I only need to add something for all my new posts in that category and all new posts of my custom post type. But I am still searching for a solution which does that part automatically if somebody knows...

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