Skip to content

Instantly share code, notes, and snippets.

View cdwharton's full-sized avatar

Chris Wharton cdwharton

View GitHub Profile
@cdwharton
cdwharton / mepr-course-ordering.php
Last active June 30, 2022 11:55
Turn on default "page" ordering for MemberPress courses
// Use Code Snippets plugin
// https://wordpress.org/plugins/code-snippets/
// If MemberPress and MP courses are active, run this code
if ((is_plugin_active('memberpress/memberpress.php')) && (is_plugin_active('memberpress-courses/main.php'))) {
// Add Page Attributes (order) support for MP Courses
add_post_type_support('mpcs-course', array( 'page-attributes' ));
// Override MP Courses the user has Started menu order
@cdwharton
cdwharton / Beaver Builder - Single page menu
Created July 9, 2020 15:48
Turn off menu on nav click
<script>
jQuery( window ).load(function() {
jQuery('.fl-responsive-nav-enabled .navbar-nav .nav-link').on( "click", function() {
jQuery('.fl-page').removeClass('fl-nav-offcanvas-active');
});
});
</script>
@media (min-width: 992px) {
.fl-page-nav-left .fl-page-header-row .col-lg-4,
.fl-page-nav-right .fl-page-header-row .col-lg-4 {
max-width: 20%;
}
.fl-page-nav-left .fl-page-header-row .col-lg-8,
.fl-page-nav-right .fl-page-header-row .col-lg-8 {
min-width: 80%;
<script>
function set_fprom(){
console.log('loaded');
$(document).on('click','button[type="submit"]', function(){
$FPROM.trackSignup({
email: $('input[type="email"]').val(),
event_id: new Date().valueOf().toString()
},
function(){})
});
/* Adjust pixel shifting for shape layers */
.fl-builder-shape-layer > svg {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000;
-moz-perspective: 1000;
-ms-perspective: 1000;
perspective: 1000;
@cdwharton
cdwharton / gist:2f3de31adce9c505d7fe2c0887adcc7c
Created April 10, 2017 21:14
WordPress Password Strength Indicator Colour Tweaks
// Add this to your functions.php and tweak as necessary :)
function login_password_css() { ?>
<style type="text/css">
.login #pass1-text.strong, .login #pass1.strong {
border-color: red;
}
.login #pass-strength-result.strong {
background-color: red;
@cdwharton
cdwharton / .htaccess
Created May 3, 2016 20:44
.htaccess speed optimizations
# ----------------------------------------------------------------------
# | File access |
# ----------------------------------------------------------------------
# Block access to directories without a default document.
#
# You should leave the following uncommented, as you shouldn't allow
# anyone to surf through every directory on your server (which may
# includes rather private places such as the CMS's directories).
@cdwharton
cdwharton / meanmenu-onepager
Last active June 18, 2021 09:06
MeanMenu for One-page websites
jQuery(document).ready(function () {
// Call main meanmenu function
jQuery('header nav').meanmenu();
// Toggle and reset classes on click (good for one page sites)
jQuery('.mean-nav ul > li > a:first-child').on( "click" , function (e) {
e.preventDefault();
jQuery('.mean-nav ul:first').slideUp();