Url and Header Title of page Portfolio

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by   J. Davis 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #772606

    Vincenzo Masciullo
    Participant

    Hello,
    I do not understand how to change the portfolio url and change the page title(header) “portfolio” in “Gallery”
    Thank you

    #774723

    J. Davis
    Keymaster

    Hi Vincenzo,

    Portfolio is a custom post type and its name and slug (url part) are predefined. You can add the code below to functions.php file of your theme in order to override slug and name:

    function change_portfolio_post_type_slug( $args ) {   
       
          $args['rewrite']['slug'] = 'gallery';
          $args['labels']['name'] = 'Gallery';
     
       return $args;
    }
    add_filter( 'cptp_portfolio_register_post_type', 'change_portfolio_post_type_slug', 10, 2 );

    We recommend to install and activate Child theme and add this code to its functions.php file not to loos the changes in case of parent theme update.

    best regards,
    J. Davis

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.