Thank you for purchasing the TownPress theme!
The goal of this theme is to provide a powerful set of tools for small to medium municipality websites right out of the box. Being a WordPress theme, it can benefit from the whole ecosystem of this wonderful platform. There are thousands of free plugins which can extend your site's features and plenty of helpful resources where you can find answers to your WordPress related questions.
We hope you will find this documentation helpful and will enjoy working with TownPress theme as much as we enjoyed developing it.
The very first step is to install WordPress itself. Once installed, we can proceed to the theme and plugins installation.
If you haven’t already, download the full package from your downloads on ThemeForest.
When you unzip the downloaded file, you will see a bunch of folders. The most important one is the THEME folder which contains the installable theme .ZIP.
Open your WordPress admin and navigate to Appearance / Themes
Upload the installable townpress.zip file
If you don’t know what a WordPress child theme is, please read this article in the WordPress codex. The article also explains how to create a child theme, but don't worry, the TownPress child theme is already included in the package.
This documentation assumes that you are running the child theme, so it is highly recommended to install it. The Child theme .ZIP can be found in Child Theme folder. Install it in exactly the same way as parent theme, described in previous steps.
Once you have both parent and child themes installed, you need to activate the child one.
Before we proceed to plugins installation, let's talk about them a little bit first. This theme comes prepackaged with several plugins. Basically, any major functionality (like events, directory, galleries, etc.) has a separate plugin. This has one big advantage - you can choose which one you need. For example, if you don't need the events functionality for your site (or you plan to use a 3rd party plugin for that), there is no reason to install the LSVR Events plugin. And same goes for LSVR Notices, LSVR Directory, LSVR Galleries, LSVR Documents and LSVR People plugins as well. But let's do a quick overview of all of those plugins so you can decide for yourself which ones you need:
One last thing. You may be worried that so many plugins can have a performance impact on your site. The truth is that the number of plugins alone has no real impact on the performance. It's the way they are coded that's important. Since almost all of those plugins were coded in-house, their optimization and performance is fully under our control. Also, don't forget that the quality of your hosting plays a very significant role in overall performance of your site.
Let's finally install some plugins. Once you've activated the theme, you should see a prompt message at the top of your admin informing you about recommended plugins.
After you activate plugins, head to your Dashboard and that’s it. Plugins should now be installed and activated. Remember that all bundled plugins can be found in the Plugins folder in full package, so you can install any of those plugins manually anytime you need (via Plugins / Add New / Upload Plugin).
Here is a list of some useful 3rd party plugins. You can install them by typing their name in the search box under Plugins / Add New:
Let start by saying that we do not recommend to import the demo data at all. Why? Because you are basically bloating your site with data you will eventually want to to get rid of sooner or later. You may be tempted to have your site to look like the demo quickly and then start customizing it to your needs, but you are actually making lot of unnecessary work for yourself. Our professional advice on how to build the site using this theme (or any other WordPress theme for that sake) is to read the documentation first (at least just browse the titles). Then (after you install the theme and all its plugins) head to Appearance / Customize and browse through all the available options to familiarize yourself with the theme. Then go back to the documentation, head to Post-Installation Setup and simply follow all the steps, read all chapters thoroughly and apply all that knowledge to your own site. That said, it is up to you of course. If you want to proceed with the demo import, read further.
The quickest way to import the demo data is using the One Click Demo Import plugin. To install it, simply go to Plugins / Add New and type "One Click Demo Import" into the search field. Once installed and activated, go to Appearance / Import Demo Content where you can import content, customizer settings and widgets separately (they should be imported exactly in this order).
Once you've imported all three (content, customizer settings and widgets), continue here.
If you want to have more control over imported data, you can do it manually. Demo data can be found in the Demo Data folder in full package.
You will notice there are several .xml files in the Demo Data folder. You can decide to import either all posts and pages or just specific post type posts.
To import the content, navigate to Tools / Import and click on WordPress. You may be prompted to install the Importer plugin if you don’t have it already. After you install and activate it, go back to Tools / Import / WordPress. Now choose which content you want to import. If you want to import everything, choose the content.xml file. If you want to upload events only, choose events.xml. You can of course do multiple imports if you want to import more than just one .xml file (for example events.xml and then documents.xml).
If you haven't installed all bundled plugins but are trying to import the content.xml file, you may notice several errors during the import process. Those are caused by the fact that posts related to missing plugins can't be imported (for example event posts without LSVR Events plugin installed). You can ignore those error messages, as they shouldn't affect the import of the other posts.
You will need the Customizer Export/Import plugin to import customizer data. Once installed and activated, go to Appearance / Customize / Export/Import and upload the customizer.dat file from the Demo Data folder.
You will need the Widget Importer & Exporter plugin to import widgets data. Once installed and activated, go to Tools / Widget Importer & Exporter and upload the widgets.wie file from the Demo Data folder.
Contact form seen on the demo, which was created using the Contact Form 7 plugin, is not included in the main demo import files. You can import it manually under Tools / Import / WordPress using the cf7-contact-form.xml file from the Demo Data folder (don't forget to configure the form after the import).
If you did quick import or manual import with events, head to Tools / Regen. Events and hit the Regenerate button. You won't be able to see any imported events on your front-end unless you do that. If you are experiencing any issues with this tool, you will have to resave each of the event posts one by one (at least those event posts you want to display).
Another important thing to keep in mind when importing events is that by default, events archive will show only the upcoming events. But some or all of the demo events may have already ended by the time you purchased the theme and did the import. The demo data may not be kept up to date with current demo site. The solution is to simply change the start/end dates for each event post you want to display on your site.
You will need to set your front page and news page under Settings / Reading.
Due to some limitations of the importing functionality, some sidebars and menus may not be set properly after the import. Just go to Appearance / Widget to configure your sidebars (for example you may want to set the menu of TownPress Menu widget to "Main Menu" in the Default Left Sidebar).
You may notice that some of the menu links won't work because they were saved as absolute URL. To make them work, either edit them manually under Appearance / Menus, or use a plugin to change them to the correct URL. Basically you need to change "http://localhost/wordpress/townpress-demo" to your site's URL.
Your first post-installation steps should head into Settings / General.
Time Zone, Date Format and Time Format settings will be used to display date info for all post types (including event start and end dates), so make sure they are set correctly based on your locale.
Now head to Settings / Permalinks and change Common Settings to Post name. You can also change URL slugs for all LSVR custom post types and their taxonomies below if needed.
If you've imported the demo content, head to Settings / Reading and choose which pages should be used as your Front page and Posts page. If you haven't imported the demo content, then don't forget to come back to this option once you create your front page and blog pages. More info.
If you already have some pages / posts on your site (for example via importing demo content), you should check out Appearance / Menus to manage your site's menus.
Head to Settings / Media and change the settings to the following values:
If you already have some images on your site, use a 3rd party plugin to regenerate new image sizes based on the settings above.
If you are going to use the Directory or Events functionalities via bundled LSVR plugins, or a header map, you will need to choose a maps provider for built-in maps to work. You can do that under Appearance / Customize / Map Settings. Please note that some providers require an unique API key for maps to work.
If you are going to use the TownPress Weather widget, you will need a OpenWeatherMap.org API Key, which you can insert under Appearance / Customize / Misc.
If your site is running in a language other than English, you should check out Appearance / Customize / Typography and set the Font Subsets option accordingly. Please note that not all font families support all font subsets.
You may also notice that not all Google Fonts are available - we handpicked only the most popular ones. If you need to use font which is not available, disable Google Fonts (uncheck Enable Google Fonts option) and use some 3rd party plugin instead.
TownPress comes with a bunch of custom post types. Working with them is very similar to working with standard WordPress posts.
Posts and pages are part of the core WordPress functionality. The best place to learn more about them is the WordPress Codex.
The following tutorial assumes that you want to create a front page similar to the "Classic Home" from the demo. The preferred way to create a front page is using the native WordPress block editor (Gutenberg). Alternatively, you can use the WPBakery Page Builder or Elementor plugin. All elements and their respective options mentioned in this tutorial are available there as well (however it is highly recommended to use the Gutenberg, unless you have some very specific reason not to).
Theme colors can be managed under Appearance / Customize / Colors. You can either choose from predefined color schemes, pick your custom colors or create your own color scheme. The difference between Custom Colors and Custom Scheme is that the latter is much more involved and requires some coding. On the other hand, it gives you more freedom and it is the recommended way for customizing theme's colors.
Since the Predefined Scheme and Custom Colors options should be pretty much self-explanatory, let's describe the process of creating your own custom color scheme.
$accent1: #ec5237; // primary accent color
There are many online tools where you can generate a hex code for your color, for example colorhexa.com. Just change #xxxxxx to the hex code of your custom color (don't forget that it has to start with the # sign). Feel free to change values of other color variables in the file as well.
If you are going to use this theme in any language other then English, you will need to translate it. The important part is that you need to translate the theme and all LSVR plugins you are using. Most of the translatable text is part of the admin area, so if you plan to translate only the front-end, there won't be that much text to translate.
There are two general approaches to translation. You can either use a 3rd party plugin, or do it the old-fashioned way via the Poedit software (recommended). If you prefer the plugin approach, check out their respective documentations on how to do that. We will describe the manual process of translation via Poedit.
Before we begin, download and install Poedit to your computer.
The whole process is very similar to theme translation, you just need to do it separately for each plugin. Let's translate the LSVR Events plugin for example (but it is the same for all LSVR plugins).
If you want to add an icon into your content, use the [lsvr_icon] shortcode (LSVR Elements plugin is required for this shortcode to work).
More icons can be added via 3rd party plugins.
Code custimization is a broad topic which goes far beyond the scope of this documentation. The best place to start learning about the developer side of the WordPress is the WordPress Codex. Most of the knowledge needed to customize the theme is not theme-specific and can be applied to any theme. There are however some specifics which can come handy when you decide to customize this particular theme.
99% of the frontend code of this theme can be customized very easily by overriding the specific template files via a child theme. Apart from the basic WordPress theme files like header.php, footer.php, etc (you can read more about WordPress template hierarchy on the WordPress Codex), you will find many theme-specific templates inside template-parts folder. Just copy any of those files to your child theme (preserve the relative path) and edit them there.
However, the code for widgets, shortcodes and blocks is not present in the theme folder. Code for all those elements resides in plugins. The good news is that frontend code of those elements is created using template files as well. You just need to find out which plugin contains the widget/shortcode you want to edit and copy its template file to your child theme under the correct folder using this formula:
For shortcodes (and blocks):
For example, if you want to override the code for the LSVR Featured Post widget, open wp-content/plugins/lsvr-elements/templates/widgets folder and copy post-featured.php file into your child theme folder under lsvr-elements/templates/widgets folder.
To display events within a specific date range use URL like this:
To display all past events, use the URL like this:
The easiest way to update the theme is to use Envato Market plugin.
Alternatively, you can download the installable townpress.zip file from your ThemeForest account / Downloads and then either unzip it and upload it under wp-content / themes via FTP (overwrite the existing townpress folder), or upload the file via admin under Appearance / Themes / Add New / Upload Theme (you will have to deactivate and remove your current version of the theme first).
Once you've updated the theme you should see an admin notification which will lead you through the process of updating the bundled plugins (if there are any which needs updating).
Alternatively, you can download the complete theme package from your ThemeForest account / Downloads, unzip it and check out the changelog.txt file to see which plugins were updated in the recent version. You will find all installable plugin files in the Plugins folder. Now, either unzip each plugin file you want to update and upload them under wp-content / plugins via FTP (overwrite the existing folders), or upload each .zip file via admin under Plugins / Add New / Upload Plugin (you will have to deactivate and remove your current versions of those plugins first).
Excerpt is a short text which can be displayed on post archive pages or in some widgets instead of the full post content. You can add excerpt for standard posts and some custom post types.
If you are using the WordPress block editor (Gutenberg), you can add excerpt in the right panel when editing a post (make sure you are switched to Document tab at the top of the panel). If you are not seeing the Excerpt field, click on "dots" icon in upper right corner to enable the field.
If you are NOT using the block editor (for example when you are using the Classic Editor plugin), then while editing a post, click on Screen Options in upper right corner, check Excerpt and scroll down to see the Excerpt field under the editor.
To add a contact form similar to one seen in the demo site, first install and activate the Contact Form 7 plugin. Then download and unzip the full theme package from your ThemeForest account / Downloads (if you haven't already) and upload the cf7-contact-form.xml file from the Demo Data folder under Tools / Import / WordPress in your admin (you may be prompted to install the additional plugin during the process). Please follow the official documentation on how to properly configure the plugin.
The easiest way to do it is to use Intuitive Custom Post Order plugin. Once instaled and activated, head to Settings / Intuitive CPO and check which post types and taxonomies you want to enable this functionality for. After that, you will be able to reorder them via simple drag & drop in your admin.
Following elements are used primarily to build the front page. If you are in a need of some basic design elements like accordions or tabs, search the official WordPress plugins repository for some additional 3rd party plugins.
This shortcode displays standard (blog) posts.
[lsvr_townpress_posts title="Latest News" icon="icon-reading" category="123" limit="8" featured_limit="1" more_label="More News" id="my_unique_id"]
This shortcode displays standard (blog) posts as a slider.
[lsvr_townpress_post_slider category="123" limit="8" align="left" show_excerpt="true" autoplay="5" overlay_opacity="90" id="my_unique_id"]
This shortcode displays a custom menu. Menu can be created under the Appearance / Menus.
[lsvr_townpress_sitemap menu_id="123" columns_count="4" id="my_unique_id"]
This shortcode displays a simple icon.
[lsvr_icon icon="icon-check" id="my_unique_id"]
Please note that TownPress 1.x and 2.x+ are NOT compatible. If you want to update your existing site which runs version 1.x to version 2.x+, you will have to basically configure the whole site from the scratch. That applies to theme options, menus, widgets, any custom theme's elements or shortcodes, but most importantly to custom posts (events, documents, galleries, notices).
Redux Framework and and LSVR Toolkit (TownPress) plugins are no longer supported in 2.x+, so if you decide to update to 2.x+, feel free to remove those plugins.
You can find the latest version of TownPress 1.x in the full package in "Legacy / TownPress v1" folder.