Change the url of Projects in Divi Theme

Question

I use the Divi Theme for a WordPress website. At the moment, everything in Projects Custom Post, have the same url in the following format:

www.mywebsite.com/projects/project-name

What I tried to do is to change the projects to a more dynamic name based on the category a project belongs. I know that I can just create a few more custom posts, but I prefer to keep it like this.

I tried to change the permalink settings to /%category%/ but then my projects didn’t work with either of the two versions.

I tried also this way, but it just changes to a new static name, without the category dynamic url:

<?php
function custom_post_name () {
return array(
'feeds' => true,
'slug' => 'anewname',
'with_front' => false,
);
}
add_filter( 'et_project_posttype_rewrite_args', 'custom_post_name' );
?>

Is there any advice to achieve this or I should turn to different custom posts?

Example:

I have two projects (a custom post type of divi theme) with the categories: foods and drinks. At the moment, the url of them are the following

  1. www.mydomain.com/projects/foodexample1
  2. www.mydomain.com/projects/drinkexample2

I want to make them as:

  1. www.mydomain.com/foods/foodexample1
  2. www.mydomain.com/drinks/drinkexample2
0
, , Tasos 3 years 2020-06-05T10:10:48-05:00 0 Answers 94 views 0

Leave an answer

Browse
Browse