Template files (added as of version 2.1) allow you to customize the display of the sign-up sheet specific pages allowing for greater flexibility with your site. The default version of these files is found in the plugins directory wp-content/plugins/sign-up-sheets-pro/theme-files.
Editing the Template
If you need to modify any of these template files, please remember to do so in an upgrade-safe way. To do this, just copy the files from the theme-files directory to the directory of your theme or child theme. Now you can go ahead and edit your copied file without worrying about your changes being overwritten next time an update comes out for Sign-up Sheets Pro.
As an example, To override the main page for each sheet just copy…
wp-content/plugins/sign-up-sheets-pro/theme-files/content-dlssus_sheet.php
and place it in…
wp-content/themes/your-theme/content-dlssus_sheet.php
You can then feel free to edit the wp-content/themes/your-theme/content-dlssus_sheet.php file as needed.
Types of Templates
Our primary templates files may have one of three prefixes (which identify their function) followed by the post type. Example: single-dlssus_sheet.php. You will find all the templates we use within the plugin’s directory at wp-content/plugins/sign-up-sheets-pro/theme-files.
Prefixes:
- single – This is the main wrapper for the individual page content and is often best kept fairly simple. This file should always call the content file inside of it with dlssus_get_template_part(‘content’);
- content – This is the actual content of the page and includes things like the page title and other elements.
- archive – This is the list page of all items. Example: the archive-dlssus_sheet.php file handles the display for the default page were you can view all your sheets without using a the shortcode which is viewable at your site url followed by /sheet such as https://www.example.com/sheet
Post Types:
- dlssus_sheet – the actual sign-up sheet
- dlssus_task – the sign-up form for each task
Globals: (as of 2.1.4)
Depending on how your theme is built, you may need to edit these globals to match the wrapper elements your theme uses. By default we set up wrappers for various themes we support out of the box, but yours may need to be a little different.
- fdsus-global/wrapper-start.php – This is called before the main SUS templates are output. (before the header and content of the sheet/tasks)
- fdsus-global/wrapper-content-start.php – This is called after wrapper-start.php and after the SUS heading, but before the SUS content.
- fdsus-global/wrapper-content-end.php – This is called after the SUS content.
- fdsus-global/wrapper-end.php – This is called after the wrapper-content-end.php.
Most Common Reason to Edit Template Files
The most common reason for editing a template file is because your theme uses different wrapping elements than those that come with the built-in WordPress themes. As of version 2.1.4, this is easily editable by adjusting the global template files as shown in the example below.
If your sign-up sheet or task pages are showing up with the content displaying oddly you can typically just update the wrappers the plugin uses to match those of your theme. This may vary by each theme, but usually an easy way to find your wrappers is to check the single.php or index.php file in your theme.
Example: Editing Wrappers
This is a simplified example, but if your single.php or index.php files show something like…
<?php get_header(); ?>
<div class="some-primary-element">
<main id="site-content">
<header><h1><?php the_title(); ?></h1></header>
<div class="your-content-wrapper">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
get_template_part('template-parts/content', get_post_type());
}
}
?>
</div><!-- .your-content-wrapper -->
</main>
<?php get_sidebar(); ?>
</div><!-- .some-primary-element -->
<?php
get_footer();
You would then add the following files to your theme to update the SUS templates to use your wrapper elements.
<div class="some-primary-element">
<main id="site-content">
<div class="your-content-wrapper">
</div><!-- .your-content-wrapper -->
</main>
<?php get_sidebar(); ?>
</div><!-- .some-primary-element -->
You may not need to edit all files, but wrapper-start.php and wrapper-end.php are the ones most typically needed depending on the theme.
Sign-up Sheets comes with built in support for all WordPress core themes back to Twenty Fifteen as well as a handful of well known 3rd party themes such as Divi, Petal, Jevelin and Enfold.
Please note that we are unable to offer support for extensive customizations to template files under our normal support agreement. If you need assistance customizing these into your theme, please contact us to request a quote and we would be happy to help.
Updating Templates in the Divi Theme
For Divi theme users, you also have the option of using the Divi Theme Builder to configure the templates for your Sign-up Sheets pages right in your admin.
1. In your admin, go to Divi > Theme Builder
2. Click “Add a New Template”
3. Configure Template Settings
Check the boxes next to “All Sign-up Sheets”, “Sign-up Sheets Archive Page”, “All Tasks”, and “Tasks Archive Page”. Note that the Sign-ups don’t currently use templates at all so you can feel free leave those un-checked. Then click the “Create Template” button.
4. Click “Add Custom Body”
5. Insert a New Row and add the Post Title and Post Content
You can select from any row template you like. Then insert a “Post Title” and “Post Content” module to output the title and content for each of the types of pages.
6. Exit and Save your changes
Your sign-up pages should now be using this new template.
If you add the [sign_up_sheet]
shortcode on page or post, you can also configure that specific page or post to use this new template in the “Template Settings” step mentioned earlier.