Change "menu" slug in url
This support request was posted in BBQ by vanwoods
- vanwoods January 29, 2014 at 10:28 am
Hi Juan,
Thanks for the translations part of the theme they work fine now!
An other question:
Is there a possibility to change the slug “menu” in the url of the menu pages? I would like to use it for something else, so the word menu is not preferable at this point.
I hope there is a way to change it.
Thanks in advance.
Regards,
PatrickJuanfra Aldasoro January 29, 2014 at 1:54 pmHello Patrick,
Thanks for writing.
The “menu” part of the URL is set when defining the “menu” Custom Post Type.
I’m pretty sure there might be a plugin in the WordPress.org plugin repository in order to get that changed.
If not, it’s pretty simple. You can check how the menu custom post type is defined in /bbq/includes/custom-post-types/menu.php
You’ll need to change the “rewrite” parameter (You can learn more here: http://codex.wordpress.org/Function_Reference/register_post_type)
Then, use something like
'rewrite' => array( 'slug' => 'whatever-you-want-instead-of-menu' ),
Finally, reset your permalinks structure in “Settings > Permalinks”.
Best,
Juan.vanwoods January 29, 2014 at 2:28 pmHi Juanfra,
Thnx for the reply!
I changed the rewrite array in /bbq/includes/custom-post-types/menu.php into
‘rewrite’ => array( ‘slug’ => ‘concepts’ ),` $args = array(
‘labels’ => $labels,
‘public’ => true,
‘publicly_queryable’ => true,
‘show_ui’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘concepts’ ),
‘capability_type’ => ‘post’,
‘hierarchical’ => false,
‘menu_icon’ => get_template_directory_uri() . ‘/engine/admin/images/btn-menu.png’,
‘menu_position’ => null,
‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘page-attributes’, ‘excerpt’ )
);`and activated the rewrite plugin where i changed “menu” into “concepts”.
I t works but I don’t know if this is the right way?
Regards,
Patrick
Juanfra Aldasoro January 29, 2014 at 2:32 pmHi Patrick,
Yes, that’s the way to set a custom slug for custom post types. Please have in mind that you changed this when updating the theme.
Best,
Juan.
This topic is marked as resolved
Only the topic author can re-open this thread.