Skip to content

Instantly share code, notes, and snippets.

@iHwy
Forked from cre8tivediva/functions.php
Created March 9, 2019 16:36
Show Gist options
  • Select an option

  • Save iHwy/47a28a33763b18b7ee9e5556e8e5fd24 to your computer and use it in GitHub Desktop.

Select an option

Save iHwy/47a28a33763b18b7ee9e5556e8e5fd24 to your computer and use it in GitHub Desktop.

Revisions

  1. @cre8tivediva cre8tivediva revised this gist Jun 2, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion functions.php
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    * Rename slug in Genesis Portfolio Plugin.
    *
    * @author Anita Carter
    * @link https://cre8tivediva.com/genesis-portfolio-pro-renaming-the-slug
    * @link https://cre8tivediva.com/rename-genesis-portfolio-slug
    */
    function rename_portfolio_custom_post_type_slug() {
    $args = get_post_type_object( 'portfolio' );
  2. @cre8tivediva cre8tivediva revised this gist Jun 2, 2017. No changes.
  3. @cre8tivediva cre8tivediva revised this gist Jun 1, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion functions.php
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    <?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 );
  4. @cre8tivediva cre8tivediva revised this gist Jun 1, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    <?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.
  5. @cre8tivediva cre8tivediva revised this gist Jun 1, 2017. 1 changed file with 12 additions and 6 deletions.
    18 changes: 12 additions & 6 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,13 @@
    // Genesis Portfolio Pro - Renaming the Slug
    add_action( 'init', 'rename_portfolio_custom_post_type_slug', 5 );
    /**
    * Rename slug in Genesis Portfolio Plugin.
    *
    * @author Anita Carter
    * @link https://cre8tivediva.com/genesis-portfolio-pro-renaming-the-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);
    }
    add_action('init', 'rename_portfolio_custom_post_type_slug', 5);
    $args = get_post_type_object( 'portfolio' );
    $args->rewrite['slug'] = 'your-new-name';

    register_post_type( $args->name, $args );
    }
  6. @cre8tivediva cre8tivediva revised this gist Jun 1, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion functions.php
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    // Rename Portfolio CPT Slug to One of Your own
    // Genesis Portfolio Pro - Renaming the Slug
    function rename_portfolio_custom_post_type_slug() {
    $args = get_post_type_object("portfolio");
    $args->rewrite["slug"] = "your-new-name";
  7. @cre8tivediva cre8tivediva revised this gist May 29, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // Change Portfolio CPT Slug to One of Your own
    function change_slug_portfolio_custom_post_type() {
    // Rename Portfolio CPT Slug to One of Your own
    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);
    }
    add_action('init', 'change_slug_portfolio_custom_post_type', 5);
    add_action('init', 'rename_portfolio_custom_post_type_slug', 5);
  8. @cre8tivediva cre8tivediva created this gist May 29, 2017.
    7 changes: 7 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    // Change Portfolio CPT Slug to One of Your own
    function change_slug_portfolio_custom_post_type() {
    $args = get_post_type_object("portfolio");
    $args->rewrite["slug"] = "your-new-name";
    register_post_type($args->name, $args);
    }
    add_action('init', 'change_slug_portfolio_custom_post_type', 5);