Optimal paths in Custom Post Type
In this article I will guide you to the optimal path for custom post type does not use the plugin.
The first declaration of a custom post type that you name with your industry, for example, you sell clothing page you set as follows: the-pond, pond-the-diamond-page …
Now we optimize the product path, when you create a loop that you will remove the product by the following path:
$link = str_replace("/products/", "/", get_permalink($POST->ID));
you set the path variable $link products in the product group …
or you can do the following when the custom post type declared as follows:
rewrite' => array('slug' => '/'),
but how many times has my pages so I can not be still used in the way, that’s how I think of this as a failure.
While the taxonomy declare that you set reasonable attention Vietnamese should not seal the best, when you declare the extra attention the following attributes:
rewrite' => array('slug' => 'duong-dan-thay-the', 'with_front' => false),
replace the path where you can replace the other words, it will be the default name of the taxonomy that you set, so when you order you should think carefully then,
this code if you replaced with “/”, it will take the name of the taxonomy that you have set, just the way you are right too.
next we will optimize the path of the custom post type details, this depends on the head now, so the upper part of the skills you do then, you finished on file for this code . htaccess Light:
RewriteRule ^/(.+)/$ /$1 [R=301,L]
RewriteRule ^products/(.+)/$ /$1 [R=301,L]
you replace the word “products” into the name of your custom post type declared above okay.
Wish you success.