In ProgressPortfolio slug on URL
- This topic has 4 replies, 2 voices, and was last updated 3 years, 2 months ago by
Althemist.
- AuthorPosts
- June 16, 2020 at 9:42 pm #23630
ruben122
ParticipantHello,
By default when you create a portfolio this path is showing –> portfolio/xxxx
I translated (with loco translate) portfolio to a custom text, let’s say aaaa
Now when I click on one of the single portfolio items it’s going to aaaa/xxxx, so it’s correct, but showing a 404 page.
There is any change in the PHP files that need to be done also?
Thanks.
June 17, 2020 at 8:50 am #23642Althemist
KeymasterHello ruben122,
I am afraid changing the slug is not that easy and it can’t be done with just translation. You’d need some extensive PHP knowledge and change the function that register the custom post type slug.
Here is a guide for one our themes. The principle is the same, you’d just need to adapt it for the Rigid theme:
Regards,
DimitarJune 17, 2020 at 10:23 pm #23711ruben122
ParticipantHi Dimitar,
Thanks for your answer.
I followed and did the changes as mentioned on the link you shared, as a result I got the following code (below). Once I applied the code on the functions.php if I click on one of the single portfolio items it’s going to kosherplaces/xxxx, so the change is good, but it’s going to a 404 page.
Any idea?
Thanks in advance.
remove_action(‘init’, ‘rigid_register_cpt_rigid_portfolio’, 5);
add_action(‘init’, ‘rigid_child_register_cpt_rigid_portfolio’, 5);function rigid_child_register_cpt_rigid_portfolio() {
$labels = array(
‘name’ => esc_html__(‘Portfolios’, ‘rigid-plugin’),
‘singular_name’ => esc_html__(‘Portfolio’, ‘rigid-plugin’),
‘add_new’ => esc_html__(‘Add New’, ‘rigid-plugin’),
‘add_new_item’ => esc_html__(‘Add New Portfolio’, ‘rigid-plugin’),
‘edit_item’ => esc_html__(‘Edit Portfolio’, ‘rigid-plugin’),
‘new_item’ => esc_html__(‘New Portfolio’, ‘rigid-plugin’),
‘view_item’ => esc_html__(‘View Portfolio’, ‘rigid-plugin’),
‘search_items’ => esc_html__(‘Search Portfolios’, ‘rigid-plugin’),
‘not_found’ => esc_html__(‘No portfolios found’, ‘rigid-plugin’),
‘not_found_in_trash’ => esc_html__(‘No portfolios found in Trash’, ‘rigid-plugin’),
‘parent_item_colon’ => esc_html__(‘Parent Portfolio:’, ‘rigid-plugin’),
‘menu_name’ => esc_html__(‘Portfolios’, ‘rigid-plugin’),
);$args = array(
‘labels’ => $labels,
‘hierarchical’ => false,
‘description’ => ‘Rigid portfolio post type’,
‘supports’ => array(‘title’, ‘editor’, ‘excerpt’, ‘author’, ‘thumbnail’, ‘trackbacks’, ‘revisions’, ‘page-attributes’),
‘taxonomies’ => array(‘rigid_portfolio_category’),
‘public’ => true,
‘show_ui’ => true,
‘show_in_menu’ => true,
‘show_in_nav_menus’ => true,
‘publicly_queryable’ => true,
‘exclude_from_search’ => false,
‘has_archive’ => true,
‘query_var’ => true,
‘can_export’ => true,
‘rewrite’ => true,
‘capability_type’ => ‘page’,
‘menu_icon’ => ‘dashicons-portfolio’,
‘rewrite’ => array(
‘slug’ => esc_html__(‘kosherplaces’, ‘rigid-plugin’)
)
);register_post_type(‘rigid-portfolio’, $args);
}June 26, 2020 at 2:20 pm #23834ruben122
ParticipantCould someone from support just reply?
July 1, 2020 at 2:19 pm #23995Althemist
KeymasterHi ruben122,
So sorry for the late reply. I’ll ask our lead developer Alex to review your code and help if there is some error or if you missed something.
Regards,
Dimitar - AuthorPosts
You must be logged in and have valid license to reply to this topic.