Skip to content

Instantly share code, notes, and snippets.

View cliffordp's full-sized avatar

Clifford cliffordp

View GitHub Profile
View PageLines LESS Color Variables Demo
.pllessdemo {
.column-2 { border: 2px solid red; }
.row-1 .column-2 { border: none; border-bottom: 2px solid red; }
.row-2 .column-2 { background: @pl-base !important; }
.row-3 .column-2 { background: @pl-text !important; }
.row-4 .column-2 { background: @pl-link !important; }
.row-5 .column-2 { background: @pl-background !important; }
.row-6 .column-2 { background: @pl-header !important; }
.row-7 .column-2 { background: @pl-footer !important; }
View only display comments on this author's posts
function wps_get_comment_list_by_user($clauses) {
if (is_admin()) {
global $user_ID, $wpdb;
$clauses['join'] = ", wp_posts";
$clauses['where'] .= " AND wp_posts.post_author = ".$user_ID." AND wp_comments.comment_post_ID = wp_posts.ID";
return $clauses;
if(!current_user_can('edit_others_posts')) {
add_filter('comments_clauses', 'wps_get_comment_list_by_user');
View Switch code based on multisite Site ID
$current_blog_id = $GLOBALS['blog_id'];
if ($current_blog_id == 1) {
// for site 1
} elseif ($current_blog_id == 2) {
// for site 2
} else {
// for rest of sites
} ?>
View Remove some Yoast SEO stuff
* Remove WordPress SEO (by Yoast) Stuff
* These different functions from various sources can come in handy when you manage sites for other people
* and you don't want to give them too much control or you don't want to risk them messing up the settings.
// get rid of WordPress SEO metabox - adapted from
if ( ! is_super_admin() ) {
cliffordp / partial wp-config.php
Last active April 4, 2020 15:33
wp-config.php conditional for WP Engine Staging Sites *** Must be placed *after* the 'DOMAIN_CURRENT_SITE' constant is defined (near the bottom of wp-config.php)
View partial wp-config.php
# WP Engine Staging Sites Rules
### Must be placed *after* the 'DOMAIN_CURRENT_SITE' (for Multisite) or 'WP_SITEURL' (for non-Multisite) constant is defined (near the bottom of Production Server's wp-config.php)
if( defined('DOMAIN_CURRENT_SITE') && preg_match('/$/', constant('DOMAIN_CURRENT_SITE')) ) {
//if( defined('WP_SITEURL') && preg_match('/$/', constant('WP_SITEURL')) ) {
cliffordp / force-ssl-url-scheme.php
Last active March 27, 2017 16:32 — forked from webaware/force-ssl-url-scheme.php
Get SSL / HTTPS to work properly on WP Engine type hosts. Jason Cohen, Aug 28 05:29 pm (CDT): This is because the SSL processing is done at the front-end caching layer and not at the back-end PHP layer. By the time the request gets back there, the protocol is HTTP again rather than HTTPS. However, WordPress also defines a PHP variable saying whe…
View force-ssl-url-scheme.php
Plugin Name: Force SSL URL Scheme
Plugin URI:
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work. Recommended to me by Jason Cohen of WP Engine on 2013-08-28.
Version: 1.0.0
Author: WebAware
Author URI:
View pagelines-dms-toolbar-customizer.php
Plugin Name: PageLines DMS Toolbar Customizer
Author: TourKick (Clifford P)
Author URI:
Plugin URI:
Description: Removes 'Get More Sections' link from Add To Page panel, removes Theme panel, and removes DMS panel from the DMS editor for non-Administrators (e.g. Editors). <strong>Edit the plugin's file to customize other options.</strong> May also choose to copy code directly into your DMS child theme's functions.php file instead of activating this plugin. <a href="" target="_blank"></a> may also be helpful.
License: GPLv2
Version: 1.1.20131105
View check-for-pagelines-dms.php
if( function_exists('pl_has_editor') ){
//PageLines v3 (DMS) is the current theme
if( !function_exists('pl_has_editor') ){
//PageLines v3 (DMS) is NOT the current theme
View nofollow-specific-category-link.php
cliffordp / hide-icon-font-icons-on-ie8-and-below.less
Created September 19, 2013 16:08
Requires PageLines' "Browser Specific CSS" plugin (for PL Framework)
View hide-icon-font-icons-on-ie8-and-below.less
.ie8 {
[class*="icon-"]:before {
content: "" !important;