Hi @softphoton002
Apologies for the confusion, there are 2 ways to customize templates in Posterno, depending on the level of customization you need.
1) By enabling theme support with add_theme_support( ‘posterno’ ); you’re “telling” Posterno to no longer load the single.php and taxonomy.php template files that come with the plugin.
When theme support is not declared, Posterno will automatically inject it’s own template files within the WordPress templates hiearchy. See here for more info on the hierarchy https://developer.ww.wp.xz.cn/themes/basics/template-hierarchy/
Declaring custom theme support is recommended only if you wish to use the taxonomy archive and single post type templates declared by the theme you’re using or if you’re building an entire theme dedicated to Posterno.
2) The other way to customize templates is by modifying the templates provided by Posterno, without the need to declare custom theme support like above https://docs.posterno.com/article/545-templates-customization. This is particularly useful if you’re just making minor adjustments to the template files.
So in your case, you should remove the custom theme declaration because it’s effectively avoiding to load the single.php and taxonomy.php files that come with Posterno. Once you’ve disabled your custom theme declaration, the files should load just fine.
Let me know if you still have issues.
Hi
I understand but I want to enable the add_theme_support( ‘posterno’ );
and I want to run plugin template’s single.php file under my child template. like this https://photos.app.goo.gl/q1wgRu6U4Z9t7b2u5 but when I am activating add_theme_support( ‘posterno’ ); my child theme folder posterno’s single.php not working. its working from parent divi theme where is default signle.php.
if I am deactivating add_theme_support( ‘posterno’ ); then my modified plugin’s single.php file working from folder posterno/templates/single.php. but I want to run this file fro child template under the folder posterno. because If I will upgrade the plugin then it will remove my changes from plugin templates.
I hope you understand where is problem?
Hi @softphoton002
There’s still some confusion on your end.
1) When the Posterno plugin is updated, it will never delete your customizations that you have done into your theme or child theme.
2) When you use add_theme_support( ‘posterno’ ) you are disabling the single.php and taxonomy.php files coming from wp-content/plugins/posterno/templates/ folder.
And you’re also disabling:
wp-content/themes/Divi/posterno/templates/single.php
wp-content/themes/Divi/posterno/templates/taxonomy.php
wp-content/themes/divi-child/posterno/templates/single.php
wp-content/themes/divi-child/posterno/templates/taxonomy.php
When those are disabled, Posterno will use your theme’s files as explained by the hierarchy here https://developer.ww.wp.xz.cn/themes/basics/template-hierarchy/
This is the intended behaviour as previously explained and it won’t be changed.
3) When you don’t use add_theme_support( ‘posterno’ ), you can use the single.php and taxonomy.php file from the following folders:
wp-content/themes/Divi/posterno/templates/single.php
wp-content/themes/Divi/posterno/templates/taxonomy.php
wp-content/themes/divi-child/posterno/templates/single.php
wp-content/themes/divi-child/posterno/templates/taxonomy.php
In any case, you should never make changes to files under wp-content/plugins/posterno/ because this is the only folder overwritten by WordPress everytime there’s an update of the Posterno plugin.
Hope this clears up the confusion.