Harvard Historical Society
Developers documentation
General Information
All the websites content is made as posts, except for the home page. This allows more flexibility for the home page. It can have sections in addition to the ACF content.
Pages are used for system functions, e.g. picture enlarge, login,…
WP -> Settings -> Advanced Editor Tools -> Classic Editor (TinyMCE)
Please do not change anything in the TinyMCE (WYSIWYG) rich text editor settings. Especially not the buttons, don’t even change their position. If you do it will break the system that ensures some buttons are hidden, except for Administrators, e.g. <> code.
WP -> Settings -> TinyMCE Config
- height: 580
- block_formats:
Body text=p;Title (h1)=h1;Headline (h2)=h2;Headline (h3)=h3;Highlighted (h4)=h4;Highlighted (h5)=h5; Special (h6)=h6;Small text (pre)=pre - preview_styles:
font-family font-size font-weight font-style text-decoration text-transform color background-color - content_css:
/wp-content/themes/pro-pmb/PMB-custom-editor-styles.css
PMB-custom-editor-styles.css
The style sheet for the TinyMCE textarea is located in /wp-content/themes/pro-pmb/PMB-custom-editor-styles.css
Most of it is a copy of the Global CSS in Cornerstone, although it has additions.
The pagination is currently set to 48 posts per page and is ready to handle 12 pages, meaning 576 posts in total.
If one of the topics exceeds this, or if you want to change the number of posts per page, the following components need to be updated:
- Section-posts
- Block-posts/featured
To add more pages, the following must be done:
- add buttons and headlines for additional pages (13, 14,…)
To change the number of posts per page, change the following:
- The looper providers for the posts
- The looper providers for the pagination
- The conditions for all the page Buttons and Headlines
Dos and Don'ts
Please, as much as possible, make all links relative. This will avoid possible issues when copying the site from staging to production and vice versa.
E.g. https:/contact/ instead of https://your-domain.com/contact
How to...
To add the ACF fields content at the end of a page for debugging purposes, check the category CAT-debug of the post.
There isn’t a place within PayPal itself to directly view your donation buttons.
- Go to the PayPal Donations page: https://www.paypal.com/donate/buttons
- Click on “Start a Campaign”
This will take you through the steps of creating a new donation button. You can customize the look and feel, set donation options, and even create a custom donation page with the link to share. By going through this process, you’ll be able to see and manage any existing donation buttons you’ve previously created with your account.
Posts
Export:
- check CAT-xfer in the posts categories
- WP -> Tools -> Export -> Posts -> Category: CAT-xfer
- Download export file
Import:
- Trash the posts you want to import and delete permanently from trash
Importing posts that already exist will not work, even if the post is in the trash! - WP -> Tools -> Import -> WordPress: run importer
- Choose file -> Upload file and import
- Assign posts to an existing user: … (choose an administrator!)
- Check: Download and import file attachments
After transfer:
- Uncheck CAT-xfer in both source and destination sites
Pages
Export:
- Change the Author of the pages to user X-fer
- WP -> Tools -> Export -> Pages -> Authors: X-fer Pages
- Download export file
Import:
- Trash the pages you want to import and delete permanently from trash
Importing pages that already exist will not work, even if they are in the trash! - WP -> Tools -> Import -> WordPress: run importer
- Choose file -> Upload file and import
- Assign pages to an existing user: … (choose an administrator!)
- Check: Download and import file attachments
After transfer:
- Change the Author back to the original one in both source and destination sites
Cornerstone components
We use a page called wpx-Cornerstone X-fer
- In Cornerstone, copy all the components you want to transfer in the page wpx-Cornerstone X-fer.
- follow the export/import procedures for pages as described above.
- In Cornerstone, copy all the components back from wpx-Cornerstone X-fer to the components they belong in.
WARNING about component IDs: Beware of components that were added after the original setup of the site. Their IDs in the source and destination sites will not match. Therefore, you will have to update all the links to these components. Indeed, the link is based on the ID, not the component name.
WARNING about Headers and Footers: Do not copy everything from headers or footers as they are different in different websites.
ACF field groups
- Use ACF -> More -> Tools
- Note: it is a good idea to deactivate and rename the field group you want to override to keep it as a BU, just in case.
Add a CSS sheet in the root of the Theme’s directory,
E.g.: wp-content/themes/pro/editor-style.css
Read all about it here: https://codex.wordpress.org/Editor_Style
Problems...
This is a known problem that happens when exporting/importing the ACF field group Posts and pages default.
If it happens, you have to edit the following fields:
- group_published -> author_post_id:
Filter by Taxonomy: Select Authors, Speakers,… in TOPICS (watch out, NOT in FEATURED) - Same in blocks -> published_author
That is normal. The left scrolling bar is intended for a Menu. On smaller screens or on the phone it becomes a modal that you open with a hamburger like icon in the navbar.
DO NOT deactivate the ACF plugin as it will prevent the site from working. You will get an error and won’t even be able to open the wp-admin screen.
This is because the PRO-PMB child uses ACF fields. If you need to deactivate ACF, first change to the PRO theme instead of PRO-PMB (Appearance -> Themes).