queue  846
support custom
Results 1 to 6 of 6

Thread: Changing the Projects slug

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    10

    Changing the Projects slug

    Hi,

    I'd need to change the name of the custom post type of 'Projects' to performances. Actually the slug for it as have changed everything else. Have found the file I need to amend in Framework folder and have added the new slug but it's not working.

    Any ideas?
    Thanks

  2. #2
    Support Anand's Avatar
    Join Date
    Jan 2014
    Posts
    3,609
    Post your admin login details in this thread so we can login to your WordPress installation and investigate the issue via the admin. You can post this information privately in this thread by wrapping the info inside a "Hide" tag as follows:

    Simply write your information into the post body as you would normally do. Then place the opening hide tag before your info, like this:

    [hide]

    Then place the closing hide tag after your private info, like this:

    [/hide]

    All info contained inside the hide tags will only be visible to forum staff

    Here is what you would type in your post:

    [hide]
    
    url:       http://yoursite.com/wp-admin
    username:  admin
    password:  yourpass
    
    [/hide]

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    10
    Hi Anand,

    Thanks and have added the details below. The Services slug also needs to change to Tickets. Trying to get everything optimised so it doesn't effect SEO too much.

    Do let me know what's been changed so I can make sure they don't get overwritten with any update.


    ** Hidden Content: You don't have sufficient privileges to see this hidden data **

  4. #4
    Support Anand's Avatar
    Join Date
    Jan 2014
    Posts
    3,609
    Hi,

    Open <theme folder>/framework/php/PeTheme/PeThemeProject.php , go to line #56 and add the

    Code:
    'rewrite' => array('slug' => 'your-slug-here'),
    Do the same for Services, the file is <theme folder>/framework/php/PeTheme/PeThemeService.php

    Don't forget to re-save your permalinks.

  5. #5
    Junior Member
    Join Date
    Feb 2014
    Posts
    10
    Hi,

    That worked a treat, thank you.

    Won't these changes be over written if the theme gets an update though? Just trying to mitigate extra edits to core theme files. Anyway this could work using a child theme?

    Thanks again

  6. #6
    Support Anand's Avatar
    Join Date
    Jan 2014
    Posts
    3,609
    Hi,

    Yes the changes will get over written on theme update. The services and projects configs are stored in a globally accessible variable, so in the child theme you could do something like

    Code:
    add_action( 'pe_theme_metabox_config_service', 'pe_theme_metabox_config_service_action', 11 );
    
    function pe_theme_metabox_config_service_action() {
        PeGlobal::$config["post_types"]["service"]['rewrite'] = 'array("slug" => "your-slug-here")';
    }
    PS: This code isn't tested, so not sure if it will work but will give you a direction to head to.