Hi,
From Your example (“www.site.com/?service=california”) i assume that You have default permalinks setting active.
On Settings -> Permalinks setting ‘Post name’ or ‘Custom Structure’ would be a good start.
If You do not want to use any SEO plugins, look at WordPress rewrite API.
Hope that helps at least a little bit.
M
Thanks for replying. Actually, no, I don’t have default permalinks set. I do have custom structure. The only links not custom are the custom post type links.
I’m using an SEO plugin. That doesn’t help me change the URL structure.
I don’t know how to use rewrite API – so I came to these forums for help.
Thanks!
Ok,
So how You created that custom post type?
What SEO plugin are You using?
M
The custom post types were built into the theme. Example here:
http://logitrans.themesawesome.com/?service=air-freight
Using Yoast’s SEO plugin.
Thank you for replying.
Well,
Logitrans is a paid theme, and i would recommend to contact theme developer. They should provide You with the solutions.
You can also try some rewrite plugin.
M
I’ve been that route. It’s a very slow process. No further advice?
Thanks.
You can dig into theme code…
Unfortunately i do not have that theme so from now on i can only guess…
There should be a function somewhere called ‘register_post_type’ and/or ‘register_taxonomy’. They are responsible for creating custom post type and taxonomy for it. It can be in functions.php, files that are included in it, in some plugin if that theme provide some…
Both should have in argument array something like ‘rewrite’.
If there is nothing like it, then it would be the best position to start messing with the code:)
Try to add 'rewrite' => array( 'slug' => 'someveryprettyslug' ) and see what happen.
M
I found this – just don’t know what to do with it to remove
“/?service=california” and just make it “california.” Can you tell from this code?
register_post_type('logitrans-service' , $args);
/*register_taxonomy(
"service-category", array("logitrans-service"), array(
"hierarchical" => true,
"label" => "Categories",
"singular_label" => "Categories",
"rewrite" => true));
register_taxonomy(
"service-tag", array("logitrans-service"), array(
"hierarchical" => false,
"label" => "Tags",
"singular_label" => "Tags",
"rewrite" => true));
register_taxonomy_for_object_type('service-category', 'logitrans-service');
register_taxonomy_for_object_type('service-tag', 'logitrans-service');*/
We may be closing to something:)
I need few more lines of code.
This:
register_post_type('logitrans-service' , $args);
is what generates post type.
Can You paste here args?
It should look somewhat like this:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'service', 'with_front' => false ),
'capability_type' => 'post',
'has_archive' => false,
);
M