DigitalCommons / sea-wordpress-theme

0 stars 1 forks source link

Install a wordpress instance on dev-0 #1

Closed wu-lee closed 4 years ago

wu-lee commented 4 years ago

Use the hostname dev.wptest.solidarityeconomy.coop

Install the wordpress theme template.

_Originally posted by @ColmMassey in https://github.com/SolidarityEconomyAssociation/sea-map/issue_comments/705069333_

wu-lee commented 4 years ago

Might be convenient to keep dev-0 just for sea-maps, and use a disposable Scaleway wordpress VM image:

https://www.scaleway.com/en/docs/deploy-wordpress-in-seconds/

ColmMassey commented 4 years ago

you make it sound easy

wu-lee commented 4 years ago

Ok, so I'm giving the Scaleway wordpress image a whirl. I've followed the steps in their doc above, created a VM with the cheapest spec (hopefully enough for now), then added the new VM's IP address to the solidarityeconomy.coop domain as wp-0.solidarityeconomy.coop

I created an admin account, username admin, email the usual SEA tech accounts one, password to be added to the password store.

After creation and initial set-up, I upgraded the word-press edition to the latest (WordPress 5.5.1–en_GB) via the admin panel.

Now, at this point, I am looking at the README.md for this project, and scratching my head wondering how to get something I can install...

wu-lee commented 4 years ago

@joebillings - would you be able to comment here?

I've managed to get grunt build to run as per the README.md file. There seemed to be some problems with the sass parameters, but I've either amended or commented them out depending on the case. See the attempt-to-build-install branch

Is installing simply a matter of zipping up one of these directories and uploading to WordPress as a plug-in? I'm not sure which directory to zip however, or whether I need to zip/upload all of them. Are these all plug-ins, or is there another name and place for them to be uploaded?

wu-lee commented 4 years ago

Ok, so the WP install is at http://wp-0.solidarityeconomy.coop.

And reading WP developer docs, and checking examples, it looks like I need to zip the theme/plug-in folder, preserving the top-level directory and its contents.

The WP theme folder is called solidarity-economony [sic]. There seems to be a second theme folder called oneltd-base containing only a file functions.php, and this makes it an invalid theme I think (mandatory index.php is missing), so omitting that.

There's also a plugins folder, containing custom-post-type-ui.

So I've installed the plugin by uploading as a zip, and activated it - seems fine, although WP immediately says there's a new version of it.

I've also attempted to install the theme by uploading as a zip, but it's so large that gets timed out before it loads (a PHP setting I think). So instead I've uploaded and unzipped it via ssh, into /var/www/wp-content/themes.

This didn't work. The site now appears as a blank page which says:

There has been a critical error on your website.

Checking /var/log/nginx/errors.log I see this stack trace:

2020/10/14 15:22:01 [error] 5466#5466: *394 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function get_field() in /var/www/wp-content/themes/solidarity-economony/functions.php:189
Stack trace:
#0 /var/www/wp-includes/class-wp-hook.php(287): sea_enqueue_scripts('')
#1 /var/www/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 /var/www/wp-includes/script-loader.php(1999): do_action('wp_enqueue_scri...')
#4 /var/www/wp-includes/class-wp-hook.php(287): wp_enqueue_scripts('')
#5 /var/www/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#6 /var/www/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#7 /var/www/wp-includes/general-template.php(3006): do_action('wp_head')
#8 /var/www/wp-content/themes/solidarity-economony/header.php(9): wp_head()
#9 /var/www/wp-includes/template.php(730): require_once('/var/www/wp-con...')
#10 /var/www/wp-includes/template.php(676): load_template('/var/www/wp-con...', true, Array)
#11 /v" while reading response header from upstream, client: 163.172.66.130, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "51.158.115.115"
wu-lee commented 4 years ago

Searching for that error finds this:

https://theme.co/forum/t/fatal-error-call-to-undefined-function-get-field-in/24177/2

Which says:

The function get_field() is from ACF Pro plugin, have you deactivated or deleted it? If yes, please re-install it again and the error should go away

wu-lee commented 4 years ago

Ok, so that ACF Pro plug-in is not free, but it is included in the theme, according to the README in this project.

Furthermore, it turns out it just isn't included (in the PHP sense), so prepending an amended version of the code on the acf website to include it in functions.php seems to work adequately. See commit here: 3144749

Given that, the solidarity-economony theme can be enabled.

wu-lee commented 4 years ago

Checking the prior issue here suggests there's a new "thing" called "Case Studies". I can add a new case-study to the list:

http://wp-0.solidarityeconomy.coop/case-studies/test-title/

I guess there's meant to be a list here, but it isn't clear - indeed, there appears to be text from the case study I added, just not delimited by anything visible:

http://wp-0.solidarityeconomy.coop/case-studies/

The case studies seem to just have a title and some text. They seem rather like a post, but to be a different category of thing.

I think this is sort of done, in that I can't think of anything else to do next. Any comments @ColmMassey ?

ColmMassey commented 4 years ago

Okay closing this and moving on the working out how the hell to use it! ;-)