Upgrading to PHP 7

This guide is for CentOS Linux systems running PHP 5.3 and up. Start by logging into WHM and making sure the server is on Apache 4. Use EasyApache 4 to upgrade if necessary. To upgrade PHP 7, SSH into the server and download Remi and EPEL Repository: $ wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm $ wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm … Continue reading “Upgrading to PHP 7”

Events Planning Form Using Javascript

A short questionnaire to direct users to the right form using Javscript window.onload = function() { document.getElementById(‘link1’).style.display = ‘none’; document.getElementById(‘link2’).style.display = ‘none’; }; //Clears div box var x, y, z; //assigns variables to radio selections function a1(answer1){ x = answer1; }; function a2(answer2){ y = answer2; }; function a3(answer3){ z = answer3; }; //if all … Continue reading “Events Planning Form Using Javascript”

List All Sites Using Custom Shortcode

Shortcodes make it easier to customize wordpress pages quickly. WordPress comes with pre-built shortcodes but we’re going to build one from scratch. You will need to add a function to your child theme’s functions.php file. This particular code builds an ordered list of all our wordpress sites under our sls.gmu.edu domain using the get_sites() function. … Continue reading “List All Sites Using Custom Shortcode”

Course Pages

Step 1: Create a New Document Step 2: Use the Courses Template and Fill in the Title, Long Title, & Resource Title with the course name. The Published checkbox is unchecked by default. Make sure to check it and hit save when you are complete. Step 3: Under the Settings Tab, use the following field … Continue reading “Course Pages”

PHP Script Swapping out GA codes

This script was used to delineate Google Analytic Tracking codes between four different sites sharing the same wordpress theme files. Originally placed in footer.php above the GA tracking code provided by Google. <?php $host = ‘https://’ . $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’]; if (strpos($host,’sls’) !== false) { $gacode =”UA-792782-19″; } elseif (strpos($host,’gai’) !== false) { $gacode =”UA-792782-21″; … Continue reading “PHP Script Swapping out GA codes”