• Resolved Aurovrata Venet

    (@aurovrata)


    Dear Jason

    thank you for a lovely little plugin.

    The instructions for customising the templates are a wee (only a little bit:) obscure but I got it to work.

    Unfortunately they do not work for child themes, so I had to make some modifications to the underlying code to get it to work. Here is what I did:

    1. In file includes/setup.php, lines 56, 63, 70, 77, 84, I replaced,
    get_theme_root() . "/" . basename(get_bloginfo("template_url"))
    with
    get_stylesheet_directory()
    This ensures that it looks in the current theme root folder (regardless if one is using a child theme or not).

    1. In file includes/setup.php, lines 58,65,72,79, 86 I replaced,
    get_bloginfo("template_url")
    with
    get_stylesheet_directory_uri()
    again this will ensure the files are loaded correctly.

    It is not advisable to modify a parent them when one had a child theme active, for parent themes are prone to being updates and re-written by WP.

    Moreover, copying the template files to the root folder, one has to rename them by adding the prefix ‘ssd-‘ to them. Hence if one copies the file templates/emailandnameform.php to the root folder, it needs to be renamed ssd-emailandnameform.php for the plugin to find it. Your instructions led me to believe initially that I could rename it to which name I wanted, so long as I had the prefix ssd- in front, which is not the case.

    Last but not least, the template files require the WP wp-load.php file to be loaded (line 4 of each template). You use a relative path to your plugin sub-folder templates which does not work when moved to the root folder of the theme, hence the quick solution is to remove ../ from the start of the path.
    However, a more permanent solution would be to load the WP root folder and build your path from there. This would your template instructions full proof.

    I hope the above helps someone out there.

    again, many thanks for this wonderful plugin.

    https://wordpress.org/plugins/ss-downloads/

  • The topic ‘Templates and child themes’ is closed to new replies.