• Resolved softphoton002

    (@softphoton002)


    Hi Support,

    I am working on divi child theme. I modified some posterno template files. but i lost the templates customization when I upgrade the posterno plugin. So I read your documentation https://docs.posterno.com/category/542-theming like how I can place the posterno templates files to my main divi child theme. I follow the same structure and place the function

    function mytheme_add_posterno_support() {
    add_theme_support( ‘posterno’ );
    }
    add_action( ‘after_setup_theme’, ‘mytheme_add_posterno_support’ );

    on function.php of my child theme. But its not picking my changes that I place on the divi child theme. I made changes in single.php file on posterno template files. I copy that same file structure to my child theme. but its picking default theme main parent theme structure. I need help to solve this solution so all changes should work from my child theme where I made posterno folder for templates changes. I hope I will get answer very soon. Thank you in Advance.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Alessandro Tesoro

    (@alessandrotesoro)

    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.

    Thread Starter softphoton002

    (@softphoton002)

    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?

    Plugin Author Alessandro Tesoro

    (@alessandrotesoro)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Template files Customizations’ is closed to new replies.