Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Portfolio URL rewrite HELP!
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Portfolio URL rewrite HELP!
Tagged: slugs, URL rewrite
- This topic has 27 replies, 5 voices, and was last updated 9 years by Rui Guerreiro – SUPPORT.
-
Posted in: Neighborhood
-
March 8, 2014 at 8:11 am #55630This reply has been marked as private.March 8, 2014 at 8:18 am #55632
it’s doesn’t work when i change it to ‘rewrite’ => array(‘slug’ => ‘portfolio’),
March 8, 2014 at 8:52 am #55633Hi,
Everything is working perfect . I tested many times and sure 100% working perfect .
I changed'rewrite' => array('slug' => 'portfolio')
at /neighborhood-child/functions.php at line 28 and wroking fine
Thanks
With Best Regards
Swift IdeasMarch 8, 2014 at 5:03 pm #55703Okay. I replaced the word ‘portfolio’ with ‘work’ after I saw you got it working and made sure that it’s all working. You were right, you got it. Thanks again for your support. You’ve been a big help.
March 8, 2014 at 5:24 pm #55707HI,
You most welcome .
Thanks 😀
With Best Regards
Swift IdeasMarch 22, 2014 at 12:12 pm #59842Hi there
Im having a similar issue but Im not using a child theme Im using the full demo content and all I want is it to read as mydomain.com/portfolio/project-name.
Ive looked for online support and other forums and I found that I could edit the portfolio-type.php file. But can you show me where I might be able to find
this file: flexform/includes/custom-post-types/portfolio-type.php
Change : ‘rewrite’ => false,
to : ‘rewrite’ => array( ‘slug’ => ‘work’ ),
I can find the file in the theme files on my desktop, but not when its uploaded to a server. Can you point me in the right direction please, when I search for it using an ftp I get as far as wp-includes but theres no /cutom-post-types.
And how should I edit the file, open in dreamweaver or text edit and where should I upload it to ex: wp-includes or wp-admin?
I need this done as soon as you can because all my images are being indexed by google and directing me to a blank page on my website. They need to direct me to my portfolio.
Please get back to me thanks
RyanMarch 22, 2014 at 12:59 pm #59850HI,
The FTP path should be your_wordpress_installtion_directory/wp-content/themes/flexform/includes/custom-post-types/portfolio-type.php .With Best Regards
Swift IdeasMarch 23, 2014 at 10:58 am #59948√ Excellent that worked! Thanks for all your help Mohammad.
regards,
RyanMarch 23, 2014 at 11:06 am #59950Hi,
You most welcome
Thanks 🙂
With Best Regards
Swift IdeasNovember 15, 2014 at 4:34 am #128535Hello Mohammad,
I’m trying to do the same thing, but I’m getting a fatal error saying I can’t redeclare that function? I’d love to get this working on my child theme.Fatal error: Cannot redeclare portfolio_register() (previously declared in /wp-content/themes/am2014/functions.php:14) in /wp-content/themes/neighborhood/includes/custom-post-types/portfolio-type.php on line 56
Anything change in wp 4.0 or the the 1.96 version of Neighborhood?
November 17, 2014 at 10:05 am #128699Hi,
That’s because you have a theme that is using a same function name.
“/wp-content/themes/am2014”If you aren’t using that theme you can delete it and that error will stop.
-Rui
November 17, 2014 at 10:46 pm #129008Hi Rui,
am2014 is my neighborhood child theme. The initial thread pointed to adding this register function to a child-theme so that it would not be written over on updates.
Sounds like I probably need to always replace the original function (or comment it out) after theme updates?
I was hoping that I might be able to do this in a more seamless fashion.
Thank you
November 17, 2014 at 11:25 pm #129015Ok, didn’t know that it was your childtheme.
Use the code below in your childtheme functions.php
function unregister_portfolio_posttype() { remove_action( 'init', 'portfolio_register', 0 ); } add_action ('after_setup_theme','unregister_portfolio_posttype'); add_action('init', 'portfolio_register'); function portfolio_register() { $labels = array( 'name' => _x('Portfolio', 'post type general name', "swiftframework"), 'singular_name' => _x('Portfolio Item', 'post type singular name', "swiftframework"), 'add_new' => _x('Add New', 'portfolio item', "swiftframework"), 'add_new_item' => __('Add New Portfolio Item', "swiftframework"), 'edit_item' => __('Edit Portfolio Item', "swiftframework"), 'new_item' => __('New Portfolio Item', "swiftframework"), 'view_item' => __('View Portfolio Item', "swiftframework"), 'search_items' => __('Search Portfolio', "swiftframework"), 'not_found' => __('No portfolio items have been added yet', "swiftframework"), 'not_found_in_trash' => __('Nothing found in Trash', "swiftframework"), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'menu_icon' => 'dashicons-format-image', 'rewrite' => array('slug' => 'work'), // Permalinks format you can change work to another 'supports' => array('title', 'editor', 'thumbnail'), 'has_archive' => true, 'taxonomies' => array('portfolio-category') ); register_post_type( 'portfolio' , $args ); }
-Rui
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.