Change “portfolio” to “products”
-
Can I change the “portfolio” slug to “products” somehow?
-
Yes,
You have to create a child theme, and add this line of code:Change the label from Portfolio to Project function prefix_change_portfolio_labels( array $args ) { $labels = array( 'name' => __( 'Projects', 'portfolioposttype' ), 'singular_name' => __( 'Project', 'portfolioposttype' ), 'add_new' => __( 'Add New Item', 'portfolioposttype' ), 'add_new_item' => __( 'Add New Project', 'portfolioposttype' ), 'edit_item' => __( 'Edit Project', 'portfolioposttype' ), 'new_item' => __( 'Add New Project', 'portfolioposttype' ), 'view_item' => __( 'View Item', 'portfolioposttype' ), 'search_items' => __( 'Search Projects', 'portfolioposttype' ), 'not_found' => __( 'No projects found', 'portfolioposttype' ), 'not_found_in_trash' => __( 'No projects found in trash', 'portfolioposttype' ), ); $args['labels'] = $labels; // Update project single permalink format, and archive slug as well. $args['rewrite'] = array( 'slug' => 'project' ); $args['has_archive'] = true; // Don't forget to visit Settings->Permalinks after changing these to flush the rewrite rules. return $args; }
Example is missing code – see full code on GitHub https://github.com/devinsays/portfolio-post-type#customization
Thanks for the great plugin!
- This reply was modified 5 years, 10 months ago by mssbee. Reason: Found answer
This seems to work for desktop, but doesn’t seem to have an effect on mobile? Or a I missing something?
Never mind, was a caching issue. All good now.
Hello!
I already have a theme (Genesis) under a child theme that has an archive-portfolio.php child theme for this plugin. I’d like to rename “Portfolio” to “Resource Library” (and therefore “Resources” instead of “projects”, etc).
I’ve tried the code in this thread, but I don’t believe I’m putting in the right place in my child theme archive-portfolio.php. I’ve already reached out to my theme developer and they can’t help me, so I was hoping you might be able to tell me where to copy and paste the proper code? Does it go inside the <?php> brackets, or outside the brackets before the genesis(); function?
Thank you for your help and your time! ??
Hi, @jenlboyle41
You should insert code into function.php file after <?php> bracket. Your function.php file should look like :
<?php // this code loads the parent's stylesheet (leave it in place unless you know what you're doing) function theme_enqueue_styles() { wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css'); wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array($parent_style)); } add_action('wp_enqueue_scripts', 'theme_enqueue_styles'); add_action('wp_enqueue_scripts', 'theme_enqueue_styles'); add_action('wp_enqueue_scripts', 'your_theme_styles'); /* Add your own functions below this line. ======================================== */ <em> here you should place a custome code to rename “Portfolio” to “Resource Library” </em>
Hello,
I really like your portfolio:) I just bought this child theme from Genesis framework, the portfolio layout is one the reasons I bought it.
I need 2 assistance:
1) I need to change portfolio name to a gallery, so the slug will be “https://hellorose.helloyoudemos.com/gallery” instead of “https://hellorose.helloyoudemos.com/portfolio” for example. I assume it will be the same concept as you have directed here?2) Also, I noticed when I enable the “wp bakery page builder” plugin the view changes from this https://hellorose.helloyoudemos.com/portfolio/ to
https://drive.google.com/file/d/1CGAz792smatulLy1i1kvsql3DzUlw-1A/view?usp=sharingPlease help!
Hi,
Will you be able to help me with this?
Thanks
Hey ony,
The above function was working for me, I’ve moved to another theme.
I’m not a developer for this plugin but I’m willing to help.
I’m on vacation right now, try with the function I have the insert above it should work,
Regarding “wp bakery page builder” , check for permalink settings it’s possible that there is some conflict with other plugins.
Also try to find answer on their site https://kb.wpbakery.com/.Cheers
I have successfully changed the label from portfolio to product. How would I change the labels for the tags and categories also?
- The topic ‘Change “portfolio” to “products”’ is closed to new replies.