Skip to content

Instantly share code, notes, and snippets.

@iHwy
Forked from cre8tivediva/functions.php
Created March 9, 2019 16:36
Show Gist options
  • Save iHwy/47a28a33763b18b7ee9e5556e8e5fd24 to your computer and use it in GitHub Desktop.
Save iHwy/47a28a33763b18b7ee9e5556e8e5fd24 to your computer and use it in GitHub Desktop.
Rename the Genesis Portfolio Slug
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
add_action( 'init', 'rename_portfolio_custom_post_type_slug', 5 );
/**
* Rename slug in Genesis Portfolio Plugin.
*
* @author Anita Carter
* @link https://cre8tivediva.com/rename-genesis-portfolio-slug
*/
function rename_portfolio_custom_post_type_slug() {
$args = get_post_type_object( 'portfolio' );
$args->rewrite['slug'] = 'your-new-name';
register_post_type( $args->name, $args );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment