简体   繁体   中英

Wordpress pages permalink rewrite

I have WooCommerce installed already and the category url of WooCommerce is like this:

url.com/product-category/category1 works fine for displaying the category.

This is what I am aiming to achieve. url.com/product-category/category1/pagename

category1 is the name of the category which is set in the page back-end in custom field.

pagename is the name of the page.

You can Organizing Your Pages with Parent page

To create a subpage

  1. Go to Administration > Pages > Add New screen.
  2. In the right menu, click the "Page Parent" drop-down menu. The drop-down menu contains a list of all the Pages already created for your site.
  3. Select the appropriate parent Page from the drop-down menu to make the current Page a child Page.
  4. Add content to the subpage.
  5. Click Publish when ready.

When your Pages are listed, the Child Page will be nested under the Parent Page. The Permalinks of your Pages will also reflect this Page hierarchy.

I looked for same solution to custom post type and found a lot codesnippet solutions for category functions here. But i will just recommend rewrites at manageable permalink like https://wordpress.org/plugins/advanced-permalinks/ . However checking out categories URL codex might be more slim option.

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