Shortcode, CPT, and ReWrites
-
I’m writing a plugin to list media post types within the context of a page using a shortcode.
This is what I have so far for “my-plugin” (for example):
* shortcode named “my-list”
* page called “my-page” containing “[my-list]” to use the shortcode
* post in “my-list” CPT page called “my-post”When I go to “my-page” to see “my-list” generated, it lists “my-post” on the page with a link to “/my-page/my-post”. When I click on the link, it goes to “/my-plugin/my-post” (which makes sense).
What I would like is for it go to “/my-page/my-post”. In fact, what I it’s not complicated, what I really want is for it to go to “/my-page/%year%/%month%/my-post”.
The most promising post to address this was this:
https://vocecommunications.com/blog/2010/11/adding-rewrite-rules-for-custom-post-types/
The only thing is that this seems overly complicated for what I want.
Is there a better answer to this?
- The topic ‘Shortcode, CPT, and ReWrites’ is closed to new replies.