Installation on a WordPress Sidebar
To add a Gift Aid Calculator to a WordPress sidebar – such as we have done on the Right Sidebar of this page – you need to have a way to run Javascript on your WordPress site. (i.e. You can’t just add Javascript behind the “Text” button on a WordPress page).
A simple way to do this (if slightly limited) is to add the Javascript code to a Widget Text Box – you can even use the default WordPress version. There are also some dedicated, free text box Plugins such as Enhanced Text Widget and more sophisticated plugins such as CSS & JavaScript Toolbox which offer more flexibility/options.
For this, you will also need a theme which allows Sidebars on Pages. Plus, if you only want the Calculator to appear on a specific Page(s) then you will need a theme which lets you have multiple custom sidebars and thus you can setup a specific sidebar for your desired Page(s).
To Install Using the Default WordPress Text Box Widget
The instructions for adding the Gift Aid Calculator to the default WordPress text widget are as follows, but they would be similar for similar plugins:
- Go to Appearance, Widgets and drag an instance of the Text Widget onto the required sidebar.
- In the “text box” part of that Widget: copy and paste all the required Gift Aid Calculator javascript code into that text box. Save the sidebar. (You can also add a Title too).
- Create a Page for the Calculator, or edit an existing page.
- Change the Page Setup/Page Layout or however your theme describes that functionality so that a Right Sidebar or Left Sidebar shows. And if you can define a custom Sidebar for this page then do so too.
- Click on ‘Update’ to publish the new page.
Installation in the Main Content of a WordPress Page
There are some plugins which allow you to add a Widget within the Page (or Post) content area. In theory, therefore, you could add a Widget similar to the above and then use a separate Plugin to post it within a Page.
