Update template using the theme api

Posted in: Newspaper
Post count: 6

Hi, i’m working on a plugin and i’m trying to update a single post template through this:td_api_single_template::update_key('single_template_1', 'file', $this->plugin_path . '/single_template_1.php');
The problem is that the plugin single_template_1.php gives me ‘class not found’ error and the only way to fix this is to include every theme class in the function.php of the plugin with a require_once. Of course there must be a better way to this. Does anyone know how to fix it?

Post count: 35449

Hi,

If you want to make some change in single_template_1 you can copy that template in child theme and make changes there.

Thank you for your understanding!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.