New Landing How can we help? Themeforest Theme Support Neighborhood Portfolio URL rewrite HELP!

Tagged: ,

Viewing 13 posts - 16 through 28 (of 28 total)
  • #55630
    derrickkempf
    Member
    Post count: 12
    This reply has been marked as private.
    #55632
    derrickkempf
    Member
    Post count: 12

    it’s doesn’t work when i change it to ‘rewrite’ => array(‘slug’ => ‘portfolio’),

    #55633
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    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 Ideas

    #55703
    derrickkempf
    Member
    Post count: 12

    Okay. 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.

    #55707
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    HI,
    You most welcome .
    Thanks 😀
    With Best Regards
    Swift Ideas

    #59842
    autenber
    Member
    Post count: 3

    Hi 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
    Ryan

    #59850
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    HI,
    The FTP path should be your_wordpress_installtion_directory/wp-content/themes/flexform/includes/custom-post-types/portfolio-type.php .

    With Best Regards
    Swift Ideas

    #59948
    autenber
    Member
    Post count: 3

    √ Excellent that worked! Thanks for all your help Mohammad.
    regards,
    Ryan

    #59950
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You most welcome
    Thanks 🙂
    With Best Regards
    Swift Ideas

    #128535
    ktheory
    Member
    Post count: 23

    Hello 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?

    #128699
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    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

    #129008
    ktheory
    Member
    Post count: 23

    Hi 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

    #129015
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Ok, 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

Viewing 13 posts - 16 through 28 (of 28 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register