Skip to content

Instantly share code, notes, and snippets.

View tmort's full-sized avatar

Tom Morton tmort

View GitHub Profile
@tmort
tmort / functions.php
Last active May 17, 2019 15:27
WordPress custom class per page based on object name.
<?php
add_filter('body_class', 'sf3_custom_body_class');
function sf3_custom_body_class($classes){
global $post;
$prefix = 'cpgname_'; //insert your own prefix
if(isset($post->post_type)){ //if a post-type is required
$prefix .= sprintf('%s_%s', $prefix, $post->post_type);
// 'cpgname_page'
@tmort
tmort / docker-compose.override.yml
Last active October 22, 2019 15:25
Devilbox Override to replace devilbox/docker-apache-2.4 with sixfoot3/docker-apache-2.4
# IMPORTANT: The version must match the version of docker-compose.yml
version: '2.1'
services:
# ------------------------------------------------------------
# Web Server
# ------------------------------------------------------------
httpd:
image: sixfoot3/docker-apache-2.4:latest
hostname: httpd
@tmort
tmort / README.md
Last active May 4, 2020 00:59
WordPress Worker Verify [Reddit Answer] [Updated]

WordPress Verify Worker

This is a response to a reddit post where a user wants to allow public users to verify if a "worker" (employee) works at the company based on an employee ID.

Original Reddit Post

https://www.reddit.com/r/Wordpress/comments/g3n5wv/wordpress_worker_verify/
Hello guys,