Themes and child themes
We have only used the themes that come with WordPress, which are usually replaced each year. We do not implement every one – too much hard work. The criteria for changing is usually the menu. The perfect menu has yet to arrive, and it’s important to test the menu on a desktop with mouse and an iPad or iPhone with a finger. (The problem usually comes with top level pages.)
We also use child themes so that we isolate our changes from updates to a theme. I don’t know if you can carry forward ‘built in’ css that is now available. We do not use these.
When starting a new theme it is necessary to copy the old child theme and update functions.php to call the new theme. Generally, I found it easier to keep all the functions (especially our shortcodes) and start over with styles.
The Gutenberg editor
This editor was introduced by WordPress in 2018 and it completely trashed our pages. Basically it couldn’t handle open shortcodes, in particular [loop] … [/loop]. The plugin “Classic editor” was installed to disable Gutenberg.
In 2022 we stopped using [loop] … [/loop] (see Tangible below) and so the Gutemberg editor was tried again. This time we found it couldn’t handle “open” html and, since theme 2021, we now have blocks of text within <section>s. So Gutenberg would change <section> to <section></section>, thereby trashing our pages again.
Since we also discovered that WordPress 5.9 (2022) also changed widget editing to Gutenberg, we removed “Classic Editor” and installed “Disable Gutenberg” which disables Gutenberg in widgets too.
“Disable Gutenberg” also lets you selectively use Gutenberg in places where it might be useful, such as Posts. Unfortunately, Gutenberg failed once again because the editor did not give access to Post Category, a major oversight there.
The main problem with Gutenberg is the fact that it brings a lot of pain, loss of key functionality but no real benefits!
Page creation
Do not use H1 or H2, these are used by the theme for page and partition headers respectively. (Check this – partitions disappeared in theme 2021)
Nor H5 and H6 which are used by the code which calls Posts onto the front page for Promotions and Notices
This is an H3 heading.
This is the break and spacing after h3.
This is an H4 heading.
This is the break and spacing after h4.
To place images and menu in the left hand margin use the following shortcode:
(NB We have used braces here instead of square brackets so that these examples are not decoded by WordPress)
{on-the-side imageid= templateid=} (this uses the <div class=GGCsideimage> so format the image.
{on-the-side} is usually immediately followed by {section-on} which starts a new block and blocks are finished by {section-off} which includes the space ready for the next section.
You can also use {ggc-featureimage id=} to format a thumbnail image.
Note: If you are using a side menu then remember to add a <div class=bottom-menu>{template id=}</div> on the last line of the page so that when we drop down to 1 column mode on small screens the class GGCsideimage disappears and the class bottom-menu appears.
Also: I couldn’t find a way to test whether the page “Play Safely” was being called from the Visitor’s menu or the Member’s menu, so to keep the side menu correct I needed to create 2 “Play Safely” pages.
The Tangible plugin
We had used the plugin “Custom Content Shortcodes” (CCS) since about 2012 to list upcoming events, news items, promotions and the 200-club results. But in 2022 they announced that it was now deprecated and is replaced by “Tangible Loops and Logic”. (The programmer who created CCS was Eliot Akira and who now works for Tangible.)
Tangible stores its code in Templates which can be called by the shortcode {template id=} and, being a closed shortcode, should not be upset by Gutenberg. Tangible has now replaced all the Loops and Widgets on the website and it is a much neater solution.
Other shortcodes we created are:
{space}, which insert a 60% high blank line.
{half}, which uses ½ to print a ½
Promotions
These are special notices that appear on the Welcome screen. But, sometimes the notice is too long, so we write such Posts (with category=promotions) as follows:
16 months golf for the price of 12
Join from 1st October 2018 and play until the end of January 2020.
<a onclick=”jQuery(‘#offer1’).toggle(‘medium’);” href=”javascript:void(0);”> More information <i class=”easypromoweb-icon-down-dir”></i></a>
<div id=”offer1″ style=”display: none; margin-top: -3em; background-color: white; position: relative; z-index:1;”>
Take advantage of this offer and join our friendly, vibrant golf club and enjoy one of the best 9 hole courses in Scotland.
Ladies & Gents subscriptions £290 (including £20 bar vouchers) plus £100 joining fee – total payable £390. Any subscription increase in 2019 will not apply to anyone who takes up this offer.
In addition, we are actively looking for intermediate golfers between the age of 18 and 25. Memberships are available for £140 with no joining fee. Junior golfers are also welcome and should contact the club for further details.
For more details on the best value for money golf in East Lothian contact the Secretary on 01620 810267
<a onclick=”jQuery(‘#offer1’).toggle(‘medium’);” href=”javascript:void(0);”> Less <i class=”easypromoweb-icon-up-></i></a>
<div id=”offer1″ style=”display: none;”>
</div>
<div class=bottom-menu>{template id=7403}</div>
