How to translate subpages | WordPress.org

[ad_1]

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?

  • This topic was modified 22 hours, 27 minutes ago by ' src=dbozich.
  • This topic was modified 22 hours, 22 minutes ago by dbozich.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer