How to force Wordpress custom post type rewrite URL on Non root blog?
-
I am having a custom post type call books and i have forced the permanentĀ linkĀ structure as /blog/%year%/%month%/%date%/%post% But unfortunately when I try to access my custom pos type posts the URL appears as /blog/post_name Is there anyway to force the wp rewrite method?
-
Answer:
Yes. 'rewrite' => array('slug' => 'books', 'with_front' => 'true'), should work. http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress
Chris Reynolds at Quora Visit the source
Other answers
Be sure to refresh your permalink structure after you make Chris's mod above (log in, go to permalinks, and click "save" again).
Eric Oliver
The few times I've had this problem I just set the permalinks to plain or something else I don't want and save.Then I set them to what I really want and save that.Always works for me.
Jeff Hawkins
Related Q & A:
- How do I add custom attributes to javascript tags in Wordpress?Best solution by WordPress
- How can I get custom fields in wordpress?Best solution by Stack Overflow
- How can I display older custom post outside the loop in Wordpress?Best solution by Quora
- How to rewrite URL using htaccess?Best solution by Stack Overflow
- How to Rewrite URL in htaccess with php?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.