Modifying themes…

Before I test a manual site backup and restore (not using plugins,) I thought I would play around a little bit with my site theme and customize it to my liking. I got myself into more work than expected. That’s usually the case.

Intent:

There were a few things I wanted to alter to focus on readability, but I didn’t necessarily want to switch the entire theme of the website from light to dark. That would be the complete opposite of my intent, ruining everything with high contrast.

I wanted the main content wrapper to remain the classic white background with black text. I wanted to make the main nav and the footer a dark color to redirect attention to the main content. Since I’m taking two different approaches to contrast; icon color, hyperlinks, and selection color has to be complimentary to the background color….what a wild ride. Not to mention, I now know what a colophon is!

Some edits have to be made to the footer.php file. The “custom css” editor built into the admin appearance panel, adds css edits to the site database. I didn’t want to be altering the main theme’s style.css file directly either. This meant I had to create a child theme.

Implementation:

I was able to setup a child theme for each virtualhost following the directions from the WordPress Codex. It’s actually pretty simple (minus hunting for the wp_enqueue_style() parent function call) to create a new theme directory, copy the code for a styles.css and functions.php that uses the “parent theme” as a dependency at page load, done.

Any alterations can now be made directly to the respective css files in the child theme, without affecting the parent theme! Any customization will now be  unaffected by theme updates! This is the way it should have been from the beginning…. No more of that ‘paste everything here’ custom css editor blob.

Now about that backup and restore… Maybe I’ll save that until next week!

A few hosting updates…

Server optimization continues

I’m continuing to tweak and modify the WAMP and WordPress server configurations, to optimize site performance using gtmetrix.com as my benchmark. I’m realizing this is more of a journey, rather than a destination. 😀

WAMP tweaks include the following:

• httpd-vhosts.conf modified with mod_rewrite rules and wildcard ^(.*)$ to write any incoming requests to one of my 3 virtual hosts (hivegate.com, mathewcnichols.com, or amsplumbingandhvac.com.) A 301 redirect for mistyped URLs may help with traffic.

• httpd-vhosts.conf modified to include IPv6 queries. Sites are now running dual stack IPv4/IPv6. GoDaddy DNS AAAA records added.

GoDaddy SBS DNS Service configured as DDNS if Spectrum changes home IP address. Not sure if this service will update IPv6 AAAA record yet!

• .htaccess modified in each site root directory to enable caching with Apache mod_expires, and php opcache.

• .htaccess modified in each site root directory to enable compression with mod_deflate and mod_filter.

WordPress plugins:

• Implementing the Google Mail API with OAuth 2.0 using Post SMTP and Contact Form 7

• Integrating Google Analytics with GADWP

• Optimizing caching even more with WP Super Cache

• SEO with Yoast

Jetpack (of course)

Next on the agenda is attempting a full website backup and restore (directory and database.) I will feel much more comfortable making major design changes once I know I can manually revert to a past snapshot!