How to translate subpages
-
I am trying to figure out how to get the plugin to translate “sub pages” from a custom post type.
For example, the plugin works on the custom post type page itself, ex:
/lessons/lesson-title
but does not work on:
/lessons/lesson-title/slideshow
I had to add a filter to make the subpages work in the first place:
add_filter('rewrite_rules_array', function ($rules) {
$subpages = array(
'slideshow' => "Slideshow"
);
$newrules = array();
foreach ($subpages as $slug => $title)
$newrules['lesson/([^/]+)/' . $slug . '/?$'] = 'index.php?lesson=$matches[1]&subpage=' . $slug;
return $newrules + $rules;
});I am wondering if I need to add some additional hooks onto the “Slideshow” subpage template or somewhere else?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.