How to fix /blog/ prefix added to course URL when using multisite environment?
-
Hi!
As you know it, the clean permalink on a multisite environment is /blog/%postname%/. Since I installed a multisite environment I have a /blog/ prefix in the regular blog posts clean permalink. After I added MasterStudy, the course permalink always has the /blog/ prefix (ex: https://mysite.com/blog/course-page/sample-course, how do I stop that and make the course page https://mysite.com/course-page/sample-course? Because it does not make any sense to have a /blog/prefix in a course permalink.
By the way, a plugin like LearnPress seems to have that fixed: on multisite or note, the permalink remains /courses/ instead of being /blog/courses/. (But I prefer to use MasterStudy, if I can have this /blog/ prefix thing fixed. Can you please fix that? In the meantime, can you please provide me with a code that could remove the /blog/ prefix while you’re working on removing it natively?
I have a piece of code, but it’s for TutorLMS, how can you please help me fix it and make it work for MasterStudy…
function fix_multisite_course_slug() {
$args = array(
‘public’ => true,
‘has_archive’ => true,
‘rewrite’ => array(
‘slug’ => tutor_utils()->get_option( ‘course_permalink_base’, ‘courses’ ),
‘with_front’ => false,
),
);
register_post_type( ‘courses’, $args );
}
add_action( ‘init’, ‘fix_multisite_course_slug’ );Thanks in advance.
- You must be logged in to reply to this topic.