Skip to content
Gallery
XR Sverige Wiki
Share
Explore
XR Webbgrupp

För utvecklare

XR webb Wordpress

Overview

WordPress site with plugins:
Short domain xrsv.se to be used with
Hosted on Miss Hosting:
Domain hosted on Njal.la
Code on self-hosted GitLab:

Development workflow

Develop and test locally on your own computer
Send merge request to collague for review
Deploy to “your” staging site (see “Uploading files / deploy site theme”)
When accepted, deploy to live site

Setting up WordPress locally

(Instructions are for Mac, but MAMP works for Windows and it might be similar process for Windows too.)

Installing Wordpress

Install MAMP:
Start MAMP (not MAMP PRO) from your Applications folder. You can configure MAMP so it automatically starts/stops Apache/MySQL. Dashboard on http://localhost:8888/MAMP/ ​
image.gif
Create a new MySQL database called wordpress on (keep utf8 setting as is)
Download WordPress:
Unzip to /Applications/MAMP/htdocs/wordpress (this is the default folder, you can )
Go to and create your new site
Make sure to fill in database name wordpress
Username and password are both rootm
Create your WordPress admin user
Manage your WordPress site on
The WordPress site is now running on
More info:
If you need multiple Wordpress installations on same machine,
Tobias recommends instead of MAMP

Troubleshooting (MAMP for Windows)

Fatal error: Uncaught Error: Class "IntlDateFormatter" not found in...
image.png
Reason:
This is due to a php internatinalization extension being excluded by default in MAMP distributions of wordpress.
Solution:
1 Turn off the running instnaces in MAMP with the “Stop servers” button ​
image.png
2 Confirm the version of php used in MAMP (MAMP → Preferences → Press “PHP”)
image.png
image.png
3 For the version you use, find the php.ini file e.g. open C:\MAMP\conf\php8.2.14\php.ini file and find the below line, then remove comment (;) at the start of it, i.e.:
;extension=php_intl.dll => ​extension=php_intl.dll 4 Save the file 5 Restart the servers, then reload the workpress page, and the error should be gone.
Documentation:

Adding the custom XR theme

Clone the custom XR theme wp-theme () into /Applications/MAMP/htdocs/wordpress/wp-content/themes/wp-theme

Importing content from live WordPress site

Export Wordpress (Tools → Export):
Import on localhost (Tools → Import):
Select your own username on all missing usernames.
Check the checkbox to download file attachments.
Start import and wait until it says “All done. Have fun!”.

Customize identity, main menu and home page

View the website on
Click Customize in top bar
Click Site Identity
Logo: search for ER-logo-White-Linear, skip cropping
Tagline: Uppror för allt levande
Then:
Go up on level, and find Menus
Check the "Primary menu" checkbox:
image.gif
Then, go up on level, and find Homepage Settings
Select Homepage = static page #1812 and Posts page = Nyheter
Click Publish to save
image.gif

Widgets

Make it look like on the production site...

Installing XR’s WordPress plug-ins

Active plug-ins:
Smart Slider 3 (slide shows on Home page etc)
Slickr Flickr (photos on Press page, but currently disallowed)
Easy Accordion (used for Kortfakta press)
Global Styles Mods
Matomo Analytics (site statistics)
Active, less important:
Redirection (for page redirects)
Phoenix Media Rename (simply rename your media files, once uploaded)
WordPress Importer (for importing WP content)
Inactive plug-ins:
Loginizer
Modern Events Calendar Lite
image.gif

Press page

Photos: Uses the Slickr Flickr plug-in:
Once installed go te the plugin and copy configuration from production site.

Calendar/Events/“På Gång” page

Plugin: Advanced Custom Fields (ACF) for calendar, on
ACF in Wordpress menu
For posts of type "Evenemang"
2 extra fields: event_date_start, event_date_end
TODO:
Stina: get local Wordpress up & running
Tom: get ACF working locally
Test Elin's latest commits, possibly push live
Sort posts according to event start date
localization to Swedish
remove old events automatically, only show future events

Creating new staging/test environments

Create domain
Press “Create a new domain”
Uncheck “Share document root”
Enter a domain e.g. mytest.extinctionrebellion.se – it will suggest to create this subfolder to the public_html folder
Point the domain in too
"A" record to 185.76.65.55, 5 min
Clone existing WordPress site into the new domain:
Press the arrow, the the "Staging" button
image.gif
In the dialog:
Select the domain you just created above in the dropdown
Disable Search Engine Visibility: check
Database Name: it will suggest e.g. “wp59501” but you can give it a name that matches the name of your staging environment e.g. dev[username]

Uploading files / deploy site theme

ZIP up the entire wp-theme folder of your updated theme
Go to the folder for your Wordpress site, and the wp-content/themes folder (it has the wp-theme subfolder that you will overwrite)
Upload the ZIP
Extract the ZIP

Databases

Domain management

Domains are handled in Njalla, not cPanel

SEO search


Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.